Author: jflesch
Date: 2008-02-17 01:54:32 +0000 (Sun, 17 Feb 2008)
New Revision: 18021

Modified:
   trunk/apps/Thaw/src/thaw/plugins/signatures/Identity.java
Log:
Move a badly placed call to Statement.close()

Modified: trunk/apps/Thaw/src/thaw/plugins/signatures/Identity.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/signatures/Identity.java   2008-02-16 
23:41:48 UTC (rev 18020)
+++ trunk/apps/Thaw/src/thaw/plugins/signatures/Identity.java   2008-02-17 
01:54:32 UTC (rev 18021)
@@ -476,14 +476,14 @@
                                st = 
db.getConnection().prepareStatement("SELECT id FROM signatures "+
                                                                         "WHERE 
publicKey = ? LIMIT 1");
                                st.setString(1, publicKey);
-                               st.execute();
-                               st.close();

                                ResultSet set = st.executeQuery();

                                if (set.next()) {
                                        int id = set.getInt("id");

+                                       st.close();
+                                       
                                        st = 
db.getConnection().prepareStatement("UPDATE signatures SET "+
                                                                                
 "privateKey = ?, trustLevel = ? "+
                                                                                
 "WHERE id = ?");
@@ -497,6 +497,8 @@
                                        Signatures.notifyIdentityUpdated(this);
                                } else {

+                                       st.close();
+                                       
                                        st = 
db.getConnection().prepareStatement("INSERT INTO signatures "+
                                                                                
 "(nickName, publicKey, privateKey, "+
                                                                                
 "isDup, trustLevel) "+


Reply via email to