Persist Implementation

This commit is contained in:
ChessNineeee committed 2021-04-07 14:00:34 +08:00
1 parent 424d182d60
commit d0ff9153d2
2 files changed
+93 -2

No files matched your search

@@ -132,7 +132,7 @@ public final class Db {
stmt.close();
}
public static List<Identity> getAllIdentityFromStorage(String name) throws Exception {
public static List<Identity> getAllIdentityFromStorage() throws Exception {
Connection c = Sqlite.getInstance().getConn();
Statement stmt = c.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * from identityinfo");
@@ -243,7 +243,7 @@ public final class Db {
c.close();
}
public Identity getDefaultIdentityFromStorage() throws Exception{
public static Identity getDefaultIdentityFromStorage() throws Exception{
Connection c = Sqlite.getInstance().getConn();
PreparedStatement pstmt = c.prepareStatement("SELECT * from identityinfo where is_default= ? LIMIT 1");
pstmt.setInt(1, 1);