1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//查詢擊殺怪物總數量
public int killmob3(String name){
int killmob = 0;
嘗試{
PreparedStatement ps = DatabaseConnection.getConnection()。prepareStatement(“ SELECT * FROM character where where name =?”);
ps.setString(1,name);
ResultSet rs = ps.executeQuery();
如果(!rs.next()){
ps.close();
rs.close();
}
killmob = rs.getInt(“ killmob2”);
ps.close();
返回殺手
} catch(Exception Ex){
System.err.println(“ killmob2”);
返回-2;
}
}
//查詢擊殺怪物數量
public int killmob2(String name){
int killmob = 0;
嘗試{
PreparedStatement ps = DatabaseConnection.getConnection()。prepareStatement(“ SELECT * FROM character where where name =?”);
ps.setString(1,name);
ResultSet rs = ps.executeQuery();
如果(!rs.next()){
ps.close();
rs.close();
}
killmob = rs.getInt(“ killmob”);
ps.close();
返回殺手
} catch(Exception Ex){
System.err.println(“ killmob”);
返回-2;
}
}