Commit a24b668 1 parent 4b40a33 commit a24b668 Copy full SHA for a24b668
File tree 1 file changed +5
-9
lines changed
src/main/java/cc/baka9/catseedlogin/bukkit/database
1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ public SQLite(JavaPlugin plugin) {
12
12
super (plugin );
13
13
}
14
14
15
- public Connection getConnection () {
15
+ public Connection getConnection () throws ClassNotFoundException , SQLException {
16
16
if (this .connection != null && !this .connection .isClosed ()) {
17
17
return this .connection ;
18
18
}
@@ -22,14 +22,10 @@ public Connection getConnection() {
22
22
plugin .getDataFolder ().mkdir ();
23
23
}
24
24
25
- try {
26
- // 加载SQLite的JDBC驱动
27
- Class .forName ("org.sqlite.JDBC" );
28
- // 创建数据库连接
29
- this .connection = DriverManager .getConnection ("jdbc:sqlite:" + plugin .getDataFolder ().getAbsolutePath () + "/accounts.db" );
30
- } catch (ClassNotFoundException | SQLException e ) {
31
- e .printStackTrace ();
32
- }
25
+ // 加载SQLite的JDBC驱动
26
+ Class .forName ("org.sqlite.JDBC" );
27
+ // 创建数据库连接
28
+ this .connection = DriverManager .getConnection ("jdbc:sqlite:" + plugin .getDataFolder ().getAbsolutePath () + "/accounts.db" );
33
29
34
30
return this .connection ;
35
31
}
You can’t perform that action at this time.
0 commit comments