Commit 5b3275a 1 parent bb68ad6 commit 5b3275a Copy full SHA for 5b3275a
File tree 3 files changed +26
-15
lines changed
src/main/java/cc/baka9/catseedlogin/bukkit
3 files changed +26
-15
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "java.jdt.ls.java.home" : " D:\\ Program Files\\ Java\\ jdk-21" ,
3
+ "java.compile.nullAnalysis.mode" : " automatic" ,
4
+ "java.configuration.runtimes" : [
5
+ {
6
+ "name" : " JavaSE-21" ,
7
+ "path" : " D:\\ Program Files\\ Java\\ jdk-21" ,
8
+ "default" : true
9
+ },
10
+ ],
11
+ "java.configuration.updateBuildConfiguration" : " interactive"
12
+ }
Original file line number Diff line number Diff line change 10
10
11
11
import java .io .*;
12
12
import java .lang .reflect .Field ;
13
- import java .nio .charset .Charset ;
14
13
import java .nio .charset .StandardCharsets ;
15
14
import java .nio .file .Files ;
16
15
import java .util .*;
Original file line number Diff line number Diff line change @@ -15,24 +15,24 @@ public SQLite(JavaPlugin javaPlugin){
15
15
16
16
17
17
@ Override
18
- public Connection getConnection () throws SQLException {
19
-
18
+ public Connection getConnection () {
19
+ try {
20
20
if (this .connection != null && !this .connection .isClosed ()) {
21
21
return this .connection ;
22
22
}
23
- if (plugin .getDataFolder ().exists ()) {
24
- try {
25
- Class .forName ("org.sqlite.JDBC" );
26
- this .connection = DriverManager .getConnection ("jdbc:sqlite:" + plugin .getDataFolder ().getAbsolutePath () + "/accounts.db" );
27
- return this .connection ;
28
- } catch (ClassNotFoundException | SQLException e ) {
29
- e .printStackTrace ();
30
- return null ;
31
- }
32
- } else {
33
- final boolean mkdir = plugin .getDataFolder ().mkdir ();
34
- return this .getConnection ();
23
+
24
+ if (!plugin .getDataFolder ().exists ()) {
25
+ plugin .getDataFolder ().mkdir ();
35
26
}
27
+
28
+ Class .forName ("org.sqlite.JDBC" );
29
+ this .connection = DriverManager .getConnection ("jdbc:sqlite:" + plugin .getDataFolder ().getAbsolutePath () + "/accounts.db" );
30
+
31
+ return this .connection ;
32
+ } catch (ClassNotFoundException | SQLException e ) {
33
+ e .printStackTrace ();
34
+ return null ;
36
35
}
36
+ }
37
37
38
38
}
You can’t perform that action at this time.
0 commit comments