📄 axionresultset.java
字号:
public void updateBoolean(String colName, boolean value) throws SQLException { updateBoolean(getResultSetIndexForColumnName(colName),value); } public void updateByte(int i, byte value) throws SQLException { throw new UnsupportedOperationException(); } public void updateByte(String colName, byte value) throws SQLException { updateByte(getResultSetIndexForColumnName(colName),value); } public void updateBytes(int i, byte[] value) throws SQLException { throw new UnsupportedOperationException(); } public void updateBytes(String colName, byte[] value) throws SQLException { updateBytes(getResultSetIndexForColumnName(colName),value); } public void updateCharacterStream(int i, Reader value, int length) throws SQLException { throw new UnsupportedOperationException(); } public void updateCharacterStream(String colName, Reader value, int length) throws SQLException { updateCharacterStream(getResultSetIndexForColumnName(colName),value,length); } public void updateDate(int i, Date value) throws SQLException { throw new UnsupportedOperationException(); } public void updateDate(String colName, Date value) throws SQLException { updateDate(getResultSetIndexForColumnName(colName),value); } public void updateDouble(int i, double value) throws SQLException { throw new UnsupportedOperationException(); } public void updateDouble(String colName, double value) throws SQLException { updateDouble(getResultSetIndexForColumnName(colName),value); } public void updateFloat(int i, float value) throws SQLException { throw new UnsupportedOperationException(); } public void updateFloat(String colName, float value) throws SQLException { updateFloat(getResultSetIndexForColumnName(colName),value); } public void updateInt(int i, int value) throws SQLException { throw new UnsupportedOperationException(); } public void updateInt(String colName, int value) throws SQLException { updateInt(getResultSetIndexForColumnName(colName),value); } public void updateLong(int i, long value) throws SQLException { throw new UnsupportedOperationException(); } public void updateLong(String colName, long value) throws SQLException { updateLong(getResultSetIndexForColumnName(colName),value); } public void updateNull(int i) throws SQLException { throw new UnsupportedOperationException(); } public void updateNull(String colName) throws SQLException { updateNull(getResultSetIndexForColumnName(colName)); } public void updateObject(int i, Object value) throws SQLException { throw new UnsupportedOperationException(); } public void updateObject(String colName, Object value) throws SQLException { updateObject(getResultSetIndexForColumnName(colName),value); } public void updateObject(int i, Object value, int scale) throws SQLException { throw new UnsupportedOperationException(); } public void updateObject(String colName, Object value, int scale) throws SQLException { updateObject(getResultSetIndexForColumnName(colName),value,scale); } public void updateRow() throws SQLException { throw new UnsupportedOperationException(); } public void updateShort(int i, short value) throws SQLException { throw new UnsupportedOperationException(); } public void updateShort(String colName, short value) throws SQLException { updateShort(getResultSetIndexForColumnName(colName),value); } public void updateString(int i, String value) throws SQLException { throw new UnsupportedOperationException(); } public void updateString(String colName, String value) throws SQLException { updateString(getResultSetIndexForColumnName(colName),value); } public void updateTime(int i, Time value) throws SQLException { throw new UnsupportedOperationException(); } public void updateTime(String colName, Time value) throws SQLException { updateTime(getResultSetIndexForColumnName(colName),value); } public void updateTimestamp(int i, Timestamp value) throws SQLException { throw new UnsupportedOperationException(); } public void updateTimestamp(String colName, Timestamp value) throws SQLException { updateTimestamp(getResultSetIndexForColumnName(colName),value); } public boolean wasNull() throws SQLException { return _wasNull; } public void setMaxRows(int max) { _maxRows = max; } //------------------------------------------------------------ Private Util /** * Get the 1-based ResultSet index for the specified column name. */ private int getResultSetIndexForColumnName(String columnname) throws SQLException { ColumnIdentifier id = null; for(int i=0;i<_selected.length;i++) { if(_selected[i] instanceof ColumnIdentifier) { id = (ColumnIdentifier)(_selected[i]); if(columnname.equalsIgnoreCase(id.getName())) { return (i+1); } } } throw new SQLException("No column named " + columnname + " found."); } /** Throw a {@link SQLException} if there is no {@link #_currentRow}. */ private final void assertCurrentRow() throws SQLException { if(null == _currentRow) { throw new SQLException("No current row"); } } private final void assertOpen() throws SQLException { if(_closed) { throw new SQLException("Already closed"); } } /** * Obtain the value from the current row for the * given 1-based (ResultSet) index, and convert it * according to the corresponding {@link DataType} */ private Object getValue(int num) throws SQLException { assertCurrentRow(); assertOpen(); Selectable sel = _selected[num-1]; try { Object val = sel.evaluate(_currentRow); _wasNull = (null == val); return val; } catch(AxionException e) { if(_log.isDebugEnabled()) { _log.debug("AxionException in getValue",e); } throw ExceptionConverter.convert(e); } } /** * Obtain the DataType for the * given 1-based (ResultSet) index */ private DataType getDataType(int num) throws SQLException { Selectable sel = _selected[num-1]; return sel.getDataType(); } //-------------------------------------------------------------- Attributes protected RowDecoratorIterator _rows = null; private RowDecorator _currentRow = null; private Selectable[] _selected = null; private boolean _closed = false; private int _maxRows = 0; private int _currentRowIndex = 0; private ResultSetMetaData _meta = null; /** Whether the last value returned was NULL. */ private boolean _wasNull = false; /** What {@link #getInt} returns when the corresponding value is NULL. */ private static final int NULL_INT = 0; /** What {@link #getFloat} returns when the corresponding value is NULL. */ private static final float NULL_FLOAT = (float)0; /** What {@link #getShort} returns when the corresponding value is NULL. */ private static final short NULL_SHORT = (short)0; /** What {@link #getLong} returns when the corresponding value is NULL. */ private static final long NULL_LONG = 0L; /** What {@link #getByte} returns when the corresponding value is NULL. */ private static final byte NULL_BYTE = (byte)0; /** What {@link #getBoolean} returns when the corresponding value is NULL. */ private static final boolean NULL_BOOLEAN = false; /** What {@link #getDouble} returns when the corresponding value is NULL. */ private static final double NULL_DOUBLE = 0d; /** What {@link #getDate} returns when the corresponding value is NULL. */ private static final Date NULL_DATE = null; /** What {@link #getTime} returns when the corresponding value is NULL. */ private static final Time NULL_TIME = null; /** What {@link #getTimestamp} returns when the corresponding value is NULL. */ private static final Timestamp NULL_TIMESTAMP = null; /** What {@link #getString} returns when the corresponding value is NULL. */ private static final String NULL_STRING = null; /** What {@link #getClob} returns when the corresponding value is NULL. */ private static final Clob NULL_CLOB = null; /** What {@link #getBlob} returns when the corresponding value is NULL. */ private static final Blob NULL_BLOB = null; /** What {@link #getBinaryStream} returns when the corresponding value is NULL. */ private static final InputStream NULL_STREAM = null; /** What {@link #getCharacterStream} returns when the corresponding value is NULL. */ private static final Reader NULL_READER = null; /** What {@link #getBigDecimal} returns when the corresponding value is NULL. */ private static final BigDecimal NULL_BIGDECIMAL = null; private static Log _log = LogFactory.getLog(AxionResultSet.class); private Transaction _transaction = null; private TransactionManager _transactionManager = null; // JDBC 3/JDK 1.4 methods /** Currently unsupported. */ public URL getURL(int arg0) throws SQLException { throw new SQLException("getURL is currently not supported"); } /** Currently unsupported. */ public URL getURL(String arg0) throws SQLException { throw new SQLException("getURL is currently not supported"); } /** Currently unsupported. */ public void updateArray(int arg0, Array arg1) throws SQLException { throw new SQLException("updateArray is currently not supported"); } /** Currently unsupported. */ public void updateArray(String arg0, Array arg1) throws SQLException { throw new SQLException("updateArray is currently not supported"); } /** Currently unsupported. */ public void updateBlob(int arg0, Blob arg1) throws SQLException { throw new SQLException("updateBlob is currently not supported"); } /** Currently unsupported. */ public void updateBlob(String arg0, Blob arg1) throws SQLException { throw new SQLException("updateBlob is currently not supported"); } /** Currently unsupported. */ public void updateClob(int arg0, Clob arg1) throws SQLException { throw new SQLException("updateClob is currently not supported"); } /** Currently unsupported. */ public void updateClob(String arg0, Clob arg1) throws SQLException { throw new SQLException("updateClob is currently not supported"); } /** Currently unsupported. */ public void updateRef(int arg0, Ref arg1) throws SQLException { throw new SQLException("updateRef is currently not supported"); } /** Currently unsupported. */ public void updateRef(String arg0, Ref arg1) throws SQLException { throw new SQLException("updateRef is currently not supported"); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -