nursyifa_pratiwi před 6 roky
revize
5d828ac487

+ 31 - 0
pom.xml

@@ -0,0 +1,31 @@
1
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3
+	<modelVersion>4.0.0</modelVersion>
4
+  
5
+  <groupId>Training1</groupId>
6
+  <artifactId>Training1</artifactId>
7
+  <version>0.0.1-SNAPSHOT</version>
8
+  <name>Training1</name>
9
+  <build>
10
+    <sourceDirectory>src</sourceDirectory>
11
+    <plugins>
12
+      <plugin>
13
+        <artifactId>maven-compiler-plugin</artifactId>
14
+        <version>3.7.0</version>
15
+        <configuration>
16
+          <source>1.8</source>
17
+          <target>1.8</target>
18
+        </configuration>
19
+      </plugin>
20
+    </plugins>
21
+  </build>
22
+  <dependencies>
23
+  <dependency>
24
+    <groupId>mysql</groupId>
25
+    <artifactId>mysql-connector-java</artifactId>
26
+    <version>5.1.40</version>
27
+</dependency>
28
+  </dependencies>
29
+
30
+  
31
+</project>

+ 29 - 0
src/com/fusi24/testing/Testing.java

@@ -0,0 +1,29 @@
1
+package com.fusi24.testing;
2
+
3
+import java.sql.ResultSet;
4
+import java.sql.SQLException;
5
+import java.util.Properties;
6
+
7
+import javax.activation.DataSource;
8
+
9
+import java.sql.DriverManager;
10
+import com.mysql.jdbc.Connection;
11
+import com.mysql.jdbc.Statement;
12
+
13
+public class Testing {
14
+
15
+
16
+	public static void main(String[] args) {
17
+			 String DATABASE_DRIVER = "com.mysql.jdbc.Driver";
18
+		     String DATABASE_URL = "jdbc:mysql://db.fusi24.com:3306/employees";
19
+		     String USERNAME = "training";
20
+		     String PASSWORD = "training";
21
+
22
+		     System.out.println("Connecting Database");
23
+		     try(Connection connection = (Connection) DriverManager.getConnection(DATABASE_URL, USERNAME, PASSWORD)){
24
+		    System.out.println();
25
+	}catch(SQLException e) {
26
+	throw new IllegalStateException("Cannot connect database", e);	
27
+	}
28
+	}
29
+}

+ 7 - 0
target/classes/META-INF/maven/Training1/Training1/pom.properties

@@ -0,0 +1,7 @@
1
+#Generated by Maven Integration for Eclipse
2
+#Tue Jun 26 17:38:01 ICT 2018
3
+version=0.0.1-SNAPSHOT
4
+groupId=Training1
5
+m2e.projectName=Training1
6
+m2e.projectLocation=E\:\\wokspace\\Training1
7
+artifactId=Training1

+ 31 - 0
target/classes/META-INF/maven/Training1/Training1/pom.xml

@@ -0,0 +1,31 @@
1
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3
+	<modelVersion>4.0.0</modelVersion>
4
+  
5
+  <groupId>Training1</groupId>
6
+  <artifactId>Training1</artifactId>
7
+  <version>0.0.1-SNAPSHOT</version>
8
+  <name>Training1</name>
9
+  <build>
10
+    <sourceDirectory>src</sourceDirectory>
11
+    <plugins>
12
+      <plugin>
13
+        <artifactId>maven-compiler-plugin</artifactId>
14
+        <version>3.7.0</version>
15
+        <configuration>
16
+          <source>1.8</source>
17
+          <target>1.8</target>
18
+        </configuration>
19
+      </plugin>
20
+    </plugins>
21
+  </build>
22
+  <dependencies>
23
+  <dependency>
24
+    <groupId>mysql</groupId>
25
+    <artifactId>mysql-connector-java</artifactId>
26
+    <version>5.1.40</version>
27
+</dependency>
28
+  </dependencies>
29
+
30
+  
31
+</project>

binární
target/classes/com/fusi24/testing/Testing.class