|
3 | 3 | import java.sql.Connection;
|
4 | 4 | import java.sql.DriverManager;
|
5 | 5 | import java.sql.SQLException;
|
6 |
| -import java.sql.Statement; |
7 | 6 |
|
8 | 7 | import com.allConfig.conf.AbstractConfig;
|
9 | 8 |
|
@@ -75,20 +74,6 @@ public static Connection createSQLLiteConnection(String DB_URL, String USER, Str
|
75 | 74 | Connection conn = null;
|
76 | 75 | Class.forName(SQLLITE_CONN_DRIVER_CLASSPATH);
|
77 | 76 | conn = DriverManager.getConnection(DB_URL, USER, PASS);
|
78 |
| - |
79 |
| - String sql1 = "CREATE TABLE IF NOT EXISTS SERVICE (SID integer, NAME text);"; |
80 |
| - // 0:in, 1: out |
81 |
| - String sql2 = "CREATE TABLE IF NOT EXISTS SERVICE_IO (SID integer, CLSPATH text, TYPE integer);"; |
82 |
| - String sql3 = "CREATE TABLE IF NOT EXISTS SERVICE_PROVIDER (PID integer,SID integer, URL text, PORT integer);"; |
83 |
| - |
84 |
| - Statement stmt = conn.createStatement(); |
85 |
| - |
86 |
| - stmt.executeUpdate(sql1); |
87 |
| - stmt.executeUpdate(sql2); |
88 |
| - stmt.executeUpdate(sql3); |
89 |
| - |
90 |
| - stmt.close(); |
91 |
| - |
92 | 77 | return conn;
|
93 | 78 | }
|
94 | 79 |
|
@@ -129,7 +114,7 @@ public static Connection getConnection(DBInfo dbInfo)
|
129 | 114 | } else if (dbInfo.getType().equals(DBType.ORACLE)) {
|
130 | 115 | return DBFactory.createOracleConnection(dbInfo.getDbUrl(), dbInfo.getDbUser(), dbInfo.getDbPass());
|
131 | 116 | } else if (dbInfo.getType().equals(DBType.SQLLITE)) {
|
132 |
| - return DBFactory.createOracleConnection(dbInfo.getDbUrl(), dbInfo.getDbUser(), dbInfo.getDbPass()); |
| 117 | + return DBFactory.createSQLLiteConnection(dbInfo.getDbUrl(), dbInfo.getDbUser(), dbInfo.getDbPass()); |
133 | 118 | }
|
134 | 119 | return null;
|
135 | 120 |
|
|
0 commit comments