Skip to content

Commit

Permalink
JDBC-Intro
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmetyagiz committed Nov 29, 2024
1 parent 39d0d36 commit c019b00
Show file tree
Hide file tree
Showing 9 changed files with 157 additions and 15 deletions.
6 changes: 6 additions & 0 deletions JDBC-Intro/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions JDBC-Intro/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions JDBC-Intro/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

74 changes: 74 additions & 0 deletions JDBC-Intro/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions JDBC-Intro/JDBC-Intro.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="jar://C:/Program Files/MySQL/mysql-connector-j-9.1.0/mysql-connector-j-9.1.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
</module>
28 changes: 28 additions & 0 deletions JDBC-Intro/src/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class Main
{
static String userName = "root";
static String password = "12345";
static String dbUrl = "jdbc:mysql://localhost:3306/world";

public static void main(String[] args) throws SQLException
{
Connection connection = null;
try
{
connection = DriverManager.getConnection(dbUrl, userName, password);
System.out.println("Connected to database");
}
catch (SQLException exception)
{
System.out.println(exception.getMessage());
}
finally
{
connection.close();
}
}
}
23 changes: 9 additions & 14 deletions Repository-Pattern/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Repository-Pattern/src/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ public class Main
{
public static void main(String[] args)
{
System.out.println("Hello, World!");
Validator validator = new Validator();
Customer customer = new Customer();
validator.validate(customer);
}
}
3 changes: 3 additions & 0 deletions Repository-Pattern/src/Validator.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
public class Validator
{
public <T extends IEntity> void validate(T entity)
{

}
}

0 comments on commit c019b00

Please sign in to comment.