コード例 #1
0
 public DatabaseResults runQuery(ObjectCache objectCache) throws SQLException {
   if (!type.isOkForQuery()) {
     throw new IllegalArgumentException("Cannot call query on a " + type + " statement");
   }
   return new JdbcDatabaseResults(
       preparedStatement, preparedStatement.executeQuery(), objectCache);
 }
コード例 #2
0
 public int runExecute() throws SQLException {
   if (!type.isOkForExecute()) {
     throw new IllegalArgumentException("Cannot call execute on a " + type + " statement");
   }
   preparedStatement.execute();
   return preparedStatement.getUpdateCount();
 }
コード例 #3
0
 public int runUpdate() throws SQLException {
   // this can be a UPDATE, DELETE, or ... just not a SELECT
   if (!type.isOkForUpdate()) {
     throw new IllegalArgumentException("Cannot call update on a " + type + " statement");
   }
   return preparedStatement.executeUpdate();
 }