]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/database/GigiPreparedStatement.java
upd: cleanup SQL statements to make them statically verifiable.
[gigi.git] / src / org / cacert / gigi / database / GigiPreparedStatement.java
index eae804b800d20fb6cc29de98ff3c56a624b56a66..a779f965fb56c150a2329b9dc6bddb6fd4842424 100644 (file)
@@ -76,6 +76,15 @@ public class GigiPreparedStatement implements AutoCloseable {
         }
     }
 
+    public void setEnum(int parameterIndex, DBEnum x) {
+        try {
+            target.setString(parameterIndex, x.getDBName());
+        } catch (SQLException e) {
+            handleSQL(e);
+            throw new Error(e);
+        }
+    }
+
     public void setDate(int parameterIndex, Date x) {
         try {
             target.setDate(parameterIndex, x);
@@ -116,6 +125,14 @@ public class GigiPreparedStatement implements AutoCloseable {
         }
     }
 
+    public int getParameterCount() {
+        try {
+            return target.getParameterMetaData().getParameterCount();
+        } catch (SQLException e) {
+            throw new Error(e);
+        }
+    }
+
     private void handleSQL(SQLException e) {
         // TODO Auto-generated method stub