Example #1
0
 public Query addParameter(String name, int value) {
   try {
     statement.setInt(name, value);
   } catch (SQLException ex) {
     throw new Sql2oException(ex);
   }
   return this;
 }
Example #2
0
 public Query addParameter(String name, Integer value) {
   try {
     if (value == null) {
       statement.setNull(name, Types.INTEGER);
     } else {
       statement.setInt(name, value);
     }
   } catch (SQLException ex) {
     throw new RuntimeException(ex);
   }
   return this;
 }