]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/database/DatabaseConnection.java
Add a verify page.
[gigi.git] / src / org / cacert / gigi / database / DatabaseConnection.java
index 9f9193a7ad0f2fedafaa45fccb415fd22e33b8d2..9cbcaeb5140fc58487d4602949942634166e123f 100644 (file)
@@ -86,4 +86,21 @@ public class DatabaseConnection {
                }
                credentials = conf;
        }
+       public void beginTransaction() throws SQLException {
+               c.setAutoCommit(false);
+       }
+       public void commitTransaction() throws SQLException {
+               c.commit();
+               c.setAutoCommit(true);
+       }
+       public void quitTransaction() {
+               try {
+                       if (!c.getAutoCommit()) {
+                               c.rollback();
+                               c.setAutoCommit(true);
+                       }
+               } catch (SQLException e) {
+                       e.printStackTrace();
+               }
+       }
 }