|
@@ -1,24 +1,28 @@
|
1
|
|
-package com.fusi24;
|
2
|
|
-
|
3
|
|
-import java.sql.Connection;
|
4
|
|
-import java.sql.DriverManager;
|
5
|
|
-
|
6
|
|
-public class Testing {
|
7
|
|
-
|
8
|
|
- static {
|
9
|
|
- try {
|
10
|
|
- Class.forName("com.mysql.jdbc.Driver");
|
11
|
|
- } catch (ClassNotFoundException ex) {
|
12
|
|
- System.err.println("Unable to load MySQL Driver");
|
13
|
|
- }
|
14
|
|
- }
|
15
|
|
-
|
16
|
|
- public static void main(String[] args) throws Exception {
|
17
|
|
- String jdbcUrl = "jdbc:mysql://db.fusi24.com:3306/employees?user=training&password=training";
|
18
|
|
-
|
19
|
|
- Connection con = DriverManager.getConnection(jdbcUrl);
|
20
|
|
- System.out.println("Connected!");
|
21
|
|
- con.close();
|
22
|
|
- }
|
23
|
|
-
|
24
|
|
-}
|
|
1
|
+package com.fusi24;
|
|
2
|
+
|
|
3
|
+import java.sql.Connection;
|
|
4
|
+import java.sql.DriverManager;
|
|
5
|
+
|
|
6
|
+public class Testing {
|
|
7
|
+
|
|
8
|
+ static {
|
|
9
|
+ try {
|
|
10
|
+ Class.forName("com.mysql.jdbc.Driver");
|
|
11
|
+ } catch (ClassNotFoundException ex) {
|
|
12
|
+ System.err.println("Unable to load MySQL Driver");
|
|
13
|
+ }
|
|
14
|
+ }
|
|
15
|
+
|
|
16
|
+ public static void main(String[] args) throws Exception {
|
|
17
|
+ String jdbcUrl = "jdbc:mysql://db.fusi24.com:3306/employees?user=training&password=training";
|
|
18
|
+
|
|
19
|
+ Connection con = DriverManager.getConnection(jdbcUrl);
|
|
20
|
+ System.out.println("Connected!");
|
|
21
|
+ con.close();
|
|
22
|
+ }
|
|
23
|
+
|
|
24
|
+ public void test() {
|
|
25
|
+
|
|
26
|
+ }
|
|
27
|
+
|
|
28
|
+}
|