Example #1
0
 public final boolean getMoreResults(int current) throws SQLException {
   switch (current) {
     case CLOSE_ALL_RESULTS:
       // currently there exists only one ResultSet
     case CLOSE_CURRENT_RESULT:
       ResultSet rs = cmd.getResultSet();
       cmd.rs = null;
       if (rs != null) rs.close();
       break;
     case KEEP_CURRENT_RESULT:
       break;
     default:
       throw SmallSQLException.create(Language.FLAGVALUE_INVALID, String.valueOf(current));
   }
   return cmd.getMoreResults();
 }
Example #2
0
 private final void executeImpl(String sql) throws SQLException {
   checkStatement();
   generatedKeys = null;
   try {
     con.log.println(sql);
     SQLParser parser = new SQLParser();
     cmd = parser.parse(con, sql);
     if (maxRows != 0 && (cmd.getMaxRows() == -1 || cmd.getMaxRows() > maxRows))
       cmd.setMaxRows(maxRows);
     cmd.execute(con, this);
   } catch (Exception e) {
     throw SmallSQLException.createFromException(e);
   }
   needGeneratedKeys = false;
   generatedKeyIndexes = null;
   generatedKeyNames = null;
 }
Example #3
0
 public final boolean execute(String sql) throws SQLException {
   executeImpl(sql);
   return cmd.getResultSet() != null;
 }
Example #4
0
 public final int executeUpdate(String sql) throws SQLException {
   executeImpl(sql);
   return cmd.getUpdateCount();
 }
Example #5
0
 public final ResultSet executeQuery(String sql) throws SQLException {
   executeImpl(sql);
   return cmd.getQueryResult();
 }
Example #6
0
 public final int getUpdateCount() throws SQLException {
   checkStatement();
   return cmd.getUpdateCount();
 }
Example #7
0
 public final ResultSet getResultSet() throws SQLException {
   checkStatement();
   return cmd.getResultSet();
 }