1 21 22 package org.apache.derby.impl.tools.ij; 23 24 import java.sql.Connection ; 25 import java.sql.ResultSet ; 26 import java.sql.Statement ; 27 import java.sql.SQLException ; 28 import java.sql.SQLWarning ; 29 30 37 class ijStatementResult extends ijResultImpl { 38 39 Statement statement; 40 boolean closeWhenDone; 41 42 ijStatementResult(Statement s, boolean c) { 43 statement = s; 44 closeWhenDone = c; 45 } 46 47 public boolean isStatement() { return true; } 48 public boolean isResultSet() throws SQLException { return statement.getUpdateCount() == -1; } 49 public boolean isUpdateCount() throws SQLException { return statement.getUpdateCount() >= 0; } 50 51 public Statement getStatement() { return statement; } 52 public int getUpdateCount() throws SQLException { return statement.getUpdateCount(); } 53 public ResultSet getResultSet() throws SQLException { return statement.getResultSet(); } 54 55 public void closeStatement() throws SQLException { if (closeWhenDone) statement.close(); } 56 57 public SQLWarning getSQLWarnings() throws SQLException { return statement.getWarnings(); } 58 public void clearSQLWarnings() throws SQLException { statement.clearWarnings(); } 59 } 60 | Popular Tags |