public GigiPreparedStatement(String stmt, boolean scroll) {
try {
- if (scroll) {
- target = DatabaseConnection.getInstance().prepareInternalScrollable(stmt);
- } else {
- target = DatabaseConnection.getInstance().prepareInternal(stmt);
- }
+ target = DatabaseConnection.getInstance().prepareInternal(stmt, scroll);
} catch (SQLException e) {
throw new Error(e);
}
}
}
+ 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);
}
}
+ 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
}
PreparedStatement tg = target;
target = null;
- DatabaseConnection.getInstance().returnStatement(tg);
+ try {
+ DatabaseConnection.getInstance().returnStatement(tg);
+ } catch (SQLException e) {
+ throw new Error(e);
+ }
}