1 22 23 package org.apache.derby.impl.tools.ij; 24 25 import java.sql.Connection ; 26 import java.sql.ResultSet ; 27 import java.sql.Statement ; 28 import java.sql.SQLException ; 29 import java.sql.SQLWarning ; 30 31 35 public class ijResultSetResult extends ijResultImpl { 36 37 ResultSet resultSet; 38 Statement statement; 39 40 int[] displayColumns = null; 41 int[] columnWidths = null; 42 43 46 public ijResultSetResult(ResultSet r) throws SQLException { 47 resultSet = r; 48 statement = resultSet.getStatement(); 49 } 50 51 61 public ijResultSetResult(ResultSet r, int[] display, 62 int[] widths) throws SQLException { 63 resultSet = r; 64 statement = resultSet.getStatement(); 65 66 displayColumns = display; 67 columnWidths = widths; 68 } 69 70 public boolean isResultSet() throws SQLException { return statement==null || statement.getUpdateCount() == -1; } 71 72 public ResultSet getResultSet() throws SQLException { return resultSet; } 73 74 public void closeStatement() throws SQLException { if(statement!=null) statement.close(); else resultSet.close(); } 75 76 public int[] getColumnDisplayList() { return displayColumns; } 77 public int[] getColumnWidthList() { return columnWidths; } 78 79 public SQLWarning getSQLWarnings() throws SQLException { return resultSet.getWarnings(); } 80 public void clearSQLWarnings() throws SQLException { resultSet.clearWarnings(); } 81 } 82 | Popular Tags |