クラス org.objectweb.cjdbc.driver.DriverResultSet

org.objectweb.cjdbc.driver.DriverResultSetのコラボレーション図

Collaboration graph
[凡例]
すべてのメンバ一覧

説明

A ResultSet provides access to a table of data generated by executing a Statement. The table rows are retrieved in sequence. Within a row its column values can be accessed in any order.

A ResultSet maintains a cursor pointing to its current row of data. Initially the cursor is positioned before the first row. The 'next' method moves the cursor to the next row.

The getXXX methods retrieve column values for the current row. You can retrieve values either using the index number of the column, or by using the name of the column. In general using the column index will be more efficient. Columns are numbered from 1.

For maximum portability, ResultSet columns within each row should be read in left-to-right order and each column should be read only once.

For the getXXX methods, the JDBC driver attempts to convert the underlying data to the specified Java type and returns a suitable Java value. See the JDBC specification for allowable mappings from SQL types to Java types with the ResultSet getXXX methods.

Column names used as input to getXXX methods are case insenstive. When performing a getXXX using a column name, if several columns have the same name, then the value of the first matching column will be returned. The column name option is designed to be used when column names are used in the SQL Query. For columns that are NOT explicitly named in the query, it is best to use column numbers. If column names were used there is no way for the programmer to guarentee that they actually refer to the intended columns.

A ResultSet is automatically closed by the Statement that generated it when that Statement is closed, re-executed, or is used to retrieve the next result from a sequence of multiple results.

The number, types and properties of a ResultSet's columns are provided by the ResultSetMetaData object returned by the getMetaData method.

参照:
java.sql.ResultSetMetaData

java.sql.ResultSet

作者:
Mark Matthews <mmatthew@worldserver.com>

Emmanuel Cecchet

Alexander Laamanen

Nicolas Modrzyk

バージョン:
1.0

DriverResultSet.java91 行で定義されています。

Public メソッド

boolean next () throws java.sql.SQLException
boolean prev () throws SQLException
boolean isBeforeFirst () throws SQLException
boolean isAfterLast () throws SQLException
boolean isFirst () throws SQLException
boolean isLast () throws SQLException
void beforeFirst () throws SQLException
void afterLast () throws SQLException
boolean first () throws SQLException
boolean last () throws SQLException
int getRow () throws SQLException
boolean absolute (int row) throws SQLException
boolean relative (int rows) throws SQLException
boolean previous () throws SQLException
void setFetchDirection (int direction) throws SQLException
int getFetchDirection () throws SQLException
void setFetchSize (int rows) throws SQLException
int getFetchSize () throws SQLException
String getString (int columnIndex) throws SQLException
boolean getBoolean (int columnIndex) throws SQLException
short getShort (int columnIndex) throws SQLException
int getInt (int columnIndex) throws SQLException
long getLong (int columnIndex) throws SQLException
float getFloat (int columnIndex) throws SQLException
double getDouble (int columnIndex) throws SQLException
BigDecimal getBigDecimal (int columnIndex, int scale) throws SQLException
byte[] getBytes (int columnIndex) throws SQLException
java.sql.Date getDate (int columnIndex) throws SQLException
Time getTime (int columnIndex) throws SQLException
Timestamp getTimestamp (int columnIndex) throws SQLException
InputStream getAsciiStream (int columnIndex) throws SQLException
InputStream getUnicodeStream (int columnIndex) throws SQLException
InputStream getBinaryStream (int columnIndex) throws SQLException
String getString (String columnName) throws SQLException
boolean getBoolean (String columnName) throws SQLException
byte getByte (String columnName) throws SQLException
short getShort (String columnName) throws SQLException
int getInt (String columnName) throws SQLException
long getLong (String columnName) throws SQLException
float getFloat (String columnName) throws SQLException
double getDouble (String columnName) throws SQLException
BigDecimal getBigDecimal (String columnName, int scale) throws SQLException
byte[] getBytes (String columnName) throws SQLException
java.sql.Date getDate (String columnName) throws SQLException
Time getTime (String columnName) throws SQLException
Timestamp getTimestamp (String columnName) throws SQLException
InputStream getAsciiStream (String columnName) throws SQLException
InputStream getUnicodeStream (String columnName) throws SQLException
InputStream getBinaryStream (String columnName) throws SQLException
java.sql.SQLWarning getWarnings () throws SQLException
void clearWarnings () throws SQLException
String getCursorName () throws SQLException
Object getObject (int columnIndex) throws SQLException
Object getObject (String columnName) throws SQLException
java.io.Reader getCharacterStream (int columnIndex) throws SQLException
java.io.Reader getCharacterStream (String columnName) throws SQLException
BigDecimal getBigDecimal (int columnIndex) throws SQLException
BigDecimal getBigDecimal (String columnName) throws SQLException
Object getObject (int i, java.util.Map map) throws SQLException
java.sql.Ref getRef (int i) throws SQLException
java.sql.Blob getBlob (int columnIndex) throws SQLException
java.sql.Clob getClob (int columnIndex) throws SQLException
java.sql.Array getArray (int columnIndex) throws SQLException
Object getObject (String colName, java.util.Map map) throws SQLException
java.sql.Ref getRef (String colName) throws SQLException
java.sql.Blob getBlob (String colName) throws SQLException
java.sql.Clob getClob (String colName) throws SQLException
java.sql.Array getArray (String colName) throws SQLException
java.sql.Date getDate (int columnIndex, Calendar cal) throws SQLException
java.sql.Date getDate (String columnName, Calendar cal) throws SQLException
java.sql.Time getTime (int columnIndex, Calendar cal) throws SQLException
java.sql.Time getTime (String columnName, Calendar cal) throws SQLException
java.sql.Timestamp getTimestamp (int columnIndex, Calendar cal) throws SQLException
java.sql.Timestamp getTimestamp (String columnName, Calendar cal) throws SQLException
boolean rowUpdated () throws SQLException
boolean rowInserted () throws SQLException
boolean rowDeleted () throws SQLException
void updateNull (int columnIndex) throws SQLException
void updateBoolean (int columnIndex, boolean x) throws SQLException
void updateByte (int columnIndex, byte x) throws SQLException
void updateShort (int columnIndex, short x) throws SQLException
void updateInt (int columnIndex, int x) throws SQLException
void updateLong (int columnIndex, long x) throws SQLException
void updateFloat (int columnIndex, float x) throws SQLException
void updateDouble (int columnIndex, double x) throws SQLException
void updateBigDecimal (int columnIndex, BigDecimal x) throws SQLException
void updateString (int columnIndex, String x) throws SQLException
void updateBytes (int columnIndex, byte x[]) throws SQLException
void updateDate (int columnIndex, java.sql.Date x) throws SQLException
void updateTime (int columnIndex, java.sql.Time x) throws SQLException
void updateTimestamp (int columnIndex, java.sql.Timestamp x) throws SQLException
void updateAsciiStream (int columnIndex, java.io.InputStream x, int length) throws SQLException
void updateBinaryStream (int columnIndex, java.io.InputStream x, int length) throws SQLException
void updateCharacterStream (int columnIndex, java.io.Reader x, int length) throws SQLException
void updateObject (int columnIndex, Object x, int scale) throws SQLException
void updateObject (int columnIndex, Object x) throws SQLException
void updateNull (String columnName) throws SQLException
void updateBoolean (String columnName, boolean x) throws SQLException
void updateByte (String columnName, byte x) throws SQLException
void updateShort (String columnName, short x) throws SQLException
void updateInt (String columnName, int x) throws SQLException
void updateLong (String columnName, long x) throws SQLException
void updateFloat (String columnName, float x) throws SQLException
void updateDouble (String columnName, double x) throws SQLException
void updateBigDecimal (String columnName, BigDecimal x) throws SQLException
void updateString (String columnName, String x) throws SQLException
void updateBytes (String columnName, byte x[]) throws SQLException
void updateDate (String columnName, java.sql.Date x) throws SQLException
void updateTime (String columnName, java.sql.Time x) throws SQLException
void updateTimestamp (String columnName, java.sql.Timestamp x) throws SQLException
void updateAsciiStream (String columnName, java.io.InputStream x, int length) throws SQLException
void updateBinaryStream (String columnName, java.io.InputStream x, int length) throws SQLException
void updateCharacterStream (String columnName, java.io.Reader reader, int length) throws SQLException
void updateObject (String columnName, Object x, int scale) throws SQLException
void updateObject (String columnName, Object x) throws SQLException
void insertRow () throws SQLException
void updateRow () throws SQLException
void deleteRow () throws SQLException
void refreshRow () throws SQLException
void cancelRowUpdates () throws SQLException
void moveToInsertRow () throws SQLException
void moveToCurrentRow () throws SQLException
int getType () throws SQLException
int getConcurrency () throws SQLException
void close () throws SQLException
boolean wasNull () throws SQLException
java.sql.Statement getStatement () throws SQLException
java.sql.ResultSetMetaData getMetaData () throws SQLException
int findColumn (String columnName) throws SQLException
 DriverResultSet (Field[] fields, ArrayList resultData)
 DriverResultSet (Field[] fields, ArrayList resultData, boolean crsHasMoreData, String cursorName)
java.net.URL getURL (int columnIndex) throws SQLException
java.net.URL getURL (String columnName) throws SQLException
void updateRef (int columnIndex, java.sql.Ref x) throws SQLException
void updateRef (String columnName, java.sql.Ref x) throws SQLException
void updateBlob (int columnIndex, java.sql.Blob x) throws SQLException
void updateBlob (String columnName, java.sql.Blob x) throws SQLException
void updateClob (int columnIndex, java.sql.Clob x) throws SQLException
void updateClob (String columnName, java.sql.Clob x) throws SQLException
void updateArray (int columnIndex, java.sql.Array x) throws SQLException
void updateArray (String columnName, java.sql.Array x) throws SQLException
byte getByte (int columnIndex) throws SQLException

Protected メソッド

void setResultSetType (int typeFlag)
void setResultSetConcurrency (int concurrencyFlag)
void setData (ArrayList newData)
void setHasMoreData (boolean hasMore)
void setStatement (Statement stmt) throws SQLException

Protected 変数

int currentRow = -1
int nbOfRows = -1
int nbOfColumns = -1
ArrayList data
int fetchDirection = FETCH_FORWARD
int fetchSize = 0
Field[] fields
boolean wasNullFlag = false
transient Hashtable columnNameToIndex = null
transient Hashtable fullColumnNameToIndex = null
int resultSetType = 0
int resultSetConcurrency = 0
SQLWarning warnings = null
transient Statement owningStatement

Private メソッド

void buildIndexMapping ()
void checkRowAndColPosAndSetNullFlag (int columnIndex) throws SQLException
void checkIfClosed () throws SQLException

Private 変数

boolean hasMoreData
String cursorName
boolean isClosed = true

Static Private 変数

final String UPDATEABLE_MESSAGE


コンストラクタとデストラクタ

org.objectweb.cjdbc.driver.DriverResultSet.DriverResultSet Field[]  fields,
ArrayList  resultData
 

Creates a new DriverResultSet.

引数:
fields an array of Field objects (basically, the ResultSet meta data)
resultData array of the actual data (data[row][column])
DriverResultSet.java2410 行で定義されています。

参照先 org.objectweb.cjdbc.driver.DriverResultSet.currentRow, org.objectweb.cjdbc.driver.DriverResultSet.data, org.objectweb.cjdbc.driver.DriverResultSet.isClosed, org.objectweb.cjdbc.driver.DriverResultSet.nbOfColumns, と org.objectweb.cjdbc.driver.DriverResultSet.nbOfRows.

02411 { 02412 currentRow = -1; 02413 this.fields = fields; 02414 data = resultData; 02415 if (data == null) 02416 nbOfRows = 0; 02417 else 02418 nbOfRows = data.size(); 02419 nbOfColumns = fields.length; 02420 isClosed = false; 02421 }

org.objectweb.cjdbc.driver.DriverResultSet.DriverResultSet Field[]  fields,
ArrayList  resultData,
boolean  crsHasMoreData,
String  cursorName
 

Creates a new DriverResultSet object from information we get back from a ControllerResultSet.

引数:
fields an array of Field objects (basically, the ResultSet meta data)
resultData array of the actual data (data[row][column])
crsHasMoreData true if remote ControllerResultSet has more data to fetch
cursorName cursor name for a streamable ResultSet
DriverResultSet.java2434 行で定義されています。

参照先 org.objectweb.cjdbc.driver.DriverResultSet.hasMoreData.

02436 { 02437 this(fields, resultData); 02438 this.cursorName = cursorName; 02439 hasMoreData = crsHasMoreData; 02440 }


メソッド

boolean org.objectweb.cjdbc.driver.DriverResultSet.absolute int  row  )  throws SQLException
 

JDBC 2.0

Move to an absolute row number in the result set.

If row is positive, moves to an absolute row with respect to the beginning of the result set. The first row is row 1, the second is row 2, etc.

If row is negative, moves to an absolute row position with respect to the end of result set. For example, calling absolute(-1) positions the cursor on the last row, absolute(-2) indicates the next-to-last row, etc.

An attempt to position the cursor beyond the first/last row in the result set, leaves the cursor before/after the first/last row, respectively.

Note: Calling absolute(1) is the same as calling first(). Calling absolute(-1) is the same as calling last().

引数:
row the row to move to
戻り値:
true if on the result set, false if off.
例外:
SQLException if a database-access error occurs, or row is 0, or result set type is TYPE_FORWARD_ONLY.
DriverResultSet.java406 行で定義されています。

参照先 org.objectweb.cjdbc.driver.DriverResultSet.afterLast(), org.objectweb.cjdbc.driver.DriverResultSet.beforeFirst(), org.objectweb.cjdbc.driver.DriverResultSet.checkIfClosed(), org.objectweb.cjdbc.driver.DriverResultSet.currentRow, org.objectweb.cjdbc.driver.DriverResultSet.first(), org.objectweb.cjdbc.driver.DriverResultSet.last(), と org.objectweb.cjdbc.driver.DriverResultSet.nbOfRows.

参照元 org.objectweb.cjdbc.driver.DriverResultSet.relative().

00407 { 00408 checkIfClosed(); 00409 if (nbOfRows == 0) 00410 return false; 00411 else 00412 { 00413 if (row == 0) 00414 throw new SQLException("Cannot absolute position to row 0"); 00415 00416 if (row == 1) 00417 return first(); 00418 else if (row == -1) 00419 return last(); 00420 else if (row > nbOfRows) 00421 { 00422 afterLast(); 00423 return false; 00424 } 00425 else 00426 { 00427 if (row < 0) 00428 { // adjust to reflect after end of result set 00429 int newRowPosition = nbOfRows + row + 1; 00430 00431 if (newRowPosition <= 0) 00432 { 00433 beforeFirst(); 00434 return false; 00435 } 00436 else 00437 return absolute(newRowPosition); 00438 } 00439 else 00440 { 00441 row--; // adjust for index difference 00442 currentRow = row; 00443 return true; 00444 } 00445 } 00446 } 00447 }

void org.objectweb.cjdbc.driver.DriverResultSet.afterLast  )  throws SQLException
 

JDBC 2.0

Moves to the end of the result set, just after the last row. Has no effect if the result set contains no rows.

例外:
SQLException if a database-access error occurs, or result set type is TYPE_FORWARD_ONLY.
DriverResultSet.java318 行で定義されています。

参照先 org.objectweb.cjdbc.driver.DriverResultSet.checkIfClosed(), org.objectweb.cjdbc.driver.DriverResultSet.currentRow, と org.objectweb.cjdbc.driver.DriverResultSet.nbOfRows.

参照元 org.objectweb.cjdbc.driver.DriverResultSet.absolute().

00319 { 00320 checkIfClosed(); 00321 if (nbOfRows != 0) 00322 currentRow = nbOfRows; 00323 }

void org.objectweb.cjdbc.driver.DriverResultSet.beforeFirst  )  throws SQLException
 

JDBC 2.0

Moves to the front of the result set, just before the first row. Has no effect if the result set contains no rows.

例外:
SQLException if a database-access error occurs, or result set type is TYPE_FORWARD_ONLY
DriverResultSet.java303 行で定義されています。

参照先 org.objectweb.cjdbc.driver.DriverResultSet.checkIfClosed(), と org.objectweb.cjdbc.driver.DriverResultSet.currentRow.

参照元 org.objectweb.cjdbc.driver.DriverResultSet.absolute().

00304 { 00305 checkIfClosed(); 00306 currentRow = -1; 00307 }

void org.objectweb.cjdbc.driver.DriverResultSet.buildIndexMapping  )  [private]
 

Builds a hash between column names and their indices for fast retrieval. DriverResultSet.java2457 行で定義されています。

参照先 org.objectweb.cjdbc.driver.DriverResultSet.columnNameToIndex, org.objectweb.cjdbc.driver.DriverResultSet.fields, org.objectweb.cjdbc.driver.DriverResultSet.fullColumnNameToIndex, org.objectweb.cjdbc.driver.Field.getFieldName(), と org.objectweb.cjdbc.driver.DriverResultSet.nbOfColumns.

参照元 org.objectweb.cjdbc.driver.DriverResultSet.findColumn().

02458 { 02459 int numFields = nbOfColumns; 02460 02461 columnNameToIndex = new Hashtable(); 02462 fullColumnNameToIndex = new Hashtable(); 02463 02464 for (int i = 0; i < numFields; i++) 02465 { 02466 Integer index = new Integer(i); 02467 02468 String columnName = fields[i].getFieldName(); 02469 String fullColumnName = fields[i].getFullName(); 02470 if (columnName != null) 02471 { 02472 columnNameToIndex.put(fields[i].getFieldName(), index); 02473 columnNameToIndex.put(fields[i].getFieldName().toUpperCase(), index); 02474 columnNameToIndex.put(fields[i].getFieldName().toLowerCase(), index); 02475 } 02476 02477 if (fullColumnName != null) 02478 { 02479 fullColumnNameToIndex.put(fields[i].getFullName(), index); 02480 fullColumnNameToIndex.put(fields[i].getFullName().toUpperCase(), index); 02481 fullColumnNameToIndex.put(fields[i].getFullName().toLowerCase(), index); 02482 } 02483 } 02484 }

void org.objectweb.cjdbc.driver.DriverResultSet.cancelRowUpdates  )  throws SQLException
 

JDBC 2.0 The cancelRowUpdates() method may be called after calling an updateXXX() method(s) and before calling updateRow() to rollback the updates made to a row. If no updates have been made or updateRow() has already been called, then this method has no effect.

例外:
SQLException if a database-access error occurs, or if called when on the insert row.
DriverResultSet.java2192 行で定義されています。
02193 { 02194 throw new NotImplementedException("cancelRowUpdates"); 02195 }

void org.objectweb.cjdbc.driver.DriverResultSet.checkIfClosed  )  throws SQLException [private]
 

Check if the ResultSet if closed and throws a SQLException if so.

例外:
SQLException if the ResultSet is closed
DriverResultSet.java2528 行で定義されています。

参照先 org.objectweb.cjdbc.driver.DriverResultSet.isClosed.

参照元 org.objectweb.cjdbc.driver.DriverResultSet.absolute(), org.objectweb.cjdbc.driver.DriverResultSet.afterLast(), org.objectweb.cjdbc.driver.DriverResultSet.beforeFirst(), org.objectweb.cjdbc.driver.DriverResultSet.checkRowAndColPosAndSetNullFlag(), org.objectweb.cjdbc.driver.DriverResultSet.first(), org.objectweb.cjdbc.driver.DriverResultSet.getRow(), org.objectweb.cjdbc.driver.DriverResultSet.isAfterLast(), org.objectweb.cjdbc.driver.DriverResultSet.isBeforeFirst(), org.objectweb.cjdbc.driver.DriverResultSet.isFirst(), org.objectweb.cjdbc.driver.DriverResultSet.isLast(), org.objectweb.cjdbc.driver.DriverResultSet.last(), org.objectweb.cjdbc.driver.DriverResultSet.next(), org.objectweb.cjdbc.driver.DriverResultSet.prev(), と org.objectweb.cjdbc.driver.DriverResultSet.relative().

02529 { 02530 if (isClosed) 02531 throw new SQLException("Trying to access a closed ResultSet"); 02532 }

void org.objectweb.cjdbc.driver.DriverResultSet.checkRowAndColPosAndSetNullFlag int  columnIndex  )  throws SQLException [private]
 

Sanity checks for result parsing

引数:
columnIndex the column to check
例外:
SQLException if an error occurs
DriverResultSet.java2492 行で定義されています。

参照先 org.objectweb.cjdbc.driver.DriverResultSet.checkIfClosed(), org.objectweb.cjdbc.driver.DriverResultSet.currentRow, org.objectweb.cjdbc.driver.DriverResultSet.data, org.objectweb.cjdbc.driver.DriverResultSet.fields, org.objectweb.cjdbc.driver.DriverResultSet.nbOfColumns, org.objectweb.cjdbc.driver.DriverResultSet.nbOfRows, と org.objectweb.cjdbc.driver.DriverResultSet.wasNullFlag.

参照元 org.objectweb.cjdbc.driver.DriverResultSet.getArray(), org.objectweb.cjdbc.driver.DriverResultSet.getAsciiStream(), org.objectweb.cjdbc.driver.DriverResultSet.getBigDecimal(), org.objectweb.cjdbc.driver.DriverResultSet.getBinaryStream(), org.objectweb.cjdbc.driver.DriverResultSet.getBoolean(), org.objectweb.cjdbc.driver.DriverResultSet.getByte(), org.objectweb.cjdbc.driver.DriverResultSet.getBytes(), org.objectweb.cjdbc.driver.DriverResultSet.getClob(), org.objectweb.cjdbc.driver.DriverResultSet.getDate(), org.objectweb.cjdbc.driver.DriverResultSet.getDouble(), org.objectweb.cjdbc.driver.DriverResultSet.getFloat(), org.objectweb.cjdbc.driver.DriverResultSet.getInt(), org.objectweb.cjdbc.driver.DriverResultSet.getLong(), org.objectweb.cjdbc.driver.DriverResultSet.getObject(), org.objectweb.cjdbc.driver.DriverResultSet.getShort(), org.objectweb.cjdbc.driver.DriverResultSet.getString(), org.objectweb.cjdbc.driver.DriverResultSet.getTime(), org.objectweb.cjdbc.driver.DriverResultSet.getTimestamp(), と org.objectweb.cjdbc.driver.DriverResultSet.getUnicodeStream().

02494 { 02495 checkIfClosed(); 02496 02497 if (currentRow < 0) 02498 throw new SQLException("Before start of result set"); 02499 02500 if (currentRow == nbOfRows) 02501 throw new SQLException("After end of result set"); 02502 02503 if (fields == null) 02504 throw new java.sql.SQLException("Query generated no fields for ResultSet"); 02505 02506 if (columnIndex < 1 || columnIndex > nbOfColumns) 02507 throw new java.sql.SQLException("Column Index out of range ( " 02508 + columnIndex + " > " + nbOfColumns + ")."); 02509 02510 try 02511 { 02512 if (((Object[]) data.get(currentRow))[columnIndex - 1] == null) 02513 wasNullFlag = true; 02514 else 02515 wasNullFlag = false; 02516 } 02517 catch (NullPointerException e) 02518 { 02519 wasNullFlag = true; 02520 } 02521 }

void org.objectweb.cjdbc.driver.DriverResultSet.clearWarnings  )  throws SQLException
 

After this call, getWarnings returns null until a new warning is reported for this ResultSet

例外:
SQLException if a database access error occurs
DriverResultSet.java1069 行で定義されています。

参照先 org.objectweb.cjdbc.driver.DriverResultSet.warnings.

参照元 org.objectweb.cjdbc.driver.DriverResultSet.next().

01070 { 01071 warnings = null; 01072 }

void org.objectweb.cjdbc.driver.DriverResultSet.close  )  throws SQLException
 

Closes the remote ResultSet if the ResultSet was streamed else just closes the ResultSet locally.

例外:
SQLException if a database access error occurs
DriverResultSet.java2266 行で定義されています。

参照先 org.objectweb.cjdbc.driver.Connection.closeRemoteResultSet(), org.objectweb.cjdbc.driver.Statement.connection, org.objectweb.cjdbc.driver.DriverResultSet.cursorName, org.objectweb.cjdbc.driver.DriverResultSet.hasMoreData, org.objectweb.cjdbc.driver.DriverResultSet.isClosed, と org.objectweb.cjdbc.driver.DriverResultSet.owningStatement.

02267 { 02268 if (hasMoreData) 02269 owningStatement.connection.closeRemoteResultSet(cursorName); 02270 isClosed = true; 02271 }

void org.objectweb.cjdbc.driver.DriverResultSet.deleteRow  )  throws SQLException
 

JDBC 2.0 Delete the current row from the result set and the underlying database. Cannot be called when on the insert row.

例外:
SQLException if a database-access error occurs, or if called when on the insert row.
DriverResultSet.java2157 行で定義されています。
02158 { 02159 throw new NotImplementedException("deleteRow"); 02160 }

int org.objectweb.cjdbc.driver.DriverResultSet.findColumn String  columnName  )  throws SQLException
 

Map a ResultSet column name to a ResultSet column index

引数:
columnName the name of the column
戻り値:
the column index
例外:
SQLException if a database access error occurs
DriverResultSet.java2370 行で定義されています。

参照先 org.objectweb.cjdbc.driver.DriverResultSet.buildIndexMapping(), org.objectweb.cjdbc.driver.DriverResultSet.columnNameToIndex, org.objectweb.cjdbc.driver.DriverResultSet.fields, org.objectweb.cjdbc.driver.DriverResultSet.fullColumnNameToIndex, org.objectweb.cjdbc.driver.Field.getFieldName(), org.objectweb.cjdbc.driver.Field.getFullName(), と org.objectweb.cjdbc.driver.DriverResultSet.nbOfColumns.

参照元 org.objectweb.cjdbc.driver.DriverResultSet.getArray(), org.objectweb.cjdbc.driver.DriverResultSet.getAsciiStream(), org.objectweb.cjdbc.driver.DriverResultSet.getBigDecimal(), org.objectweb.cjdbc.driver.DriverResultSet.getBinaryStream(), org.objectweb.cjdbc.driver.DriverResultSet.getBlob(), org.objectweb.cjdbc.driver.DriverResultSet.getBoolean(), org.objectweb.cjdbc.driver.DriverResultSet.getByte(), org.objectweb.cjdbc.driver.DriverResultSet.getBytes(), org.objectweb.cjdbc.driver.DriverResultSet.getClob(), org.objectweb.cjdbc.driver.DriverResultSet.getDate(), org.objectweb.cjdbc.driver.DriverResultSet.getDouble(), org.objectweb.cjdbc.driver.DriverResultSet.getFloat(), org.objectweb.cjdbc.driver.DriverResultSet.getInt(), org.objectweb.cjdbc.driver.DriverResultSet.getLong(), org.objectweb.cjdbc.driver.DriverResultSet.getObject(), org.objectweb.cjdbc.driver.DriverResultSet.getShort(), org.objectweb.cjdbc.driver.DriverResultSet.getString(), org.objectweb.cjdbc.driver.DriverResultSet.getTime(), org.objectweb.cjdbc.driver.DriverResultSet.getTimestamp(), と org.objectweb.cjdbc.driver.DriverResultSet.getUnicodeStream().

02371 { 02372 if (columnNameToIndex == null) 02373 buildIndexMapping(); 02374 02375 Integer index = (Integer) columnNameToIndex.get(columnName); 02376 02377 if (index == null) 02378 index = (Integer) fullColumnNameToIndex.get(columnName); 02379 02380 if (index != null) 02381 return index.intValue() + 1; 02382 else 02383 { 02384 // Try this inefficient way, now 02385 String columnNameUC = columnName.toUpperCase(); 02386 for (int i = 0; i < nbOfColumns; i++) 02387 { 02388 if (fields[i].getFieldName().toUpperCase().equals(columnNameUC)) 02389 return i + 1; 02390 else if (fields[i].getFullName().toUpperCase().equals(columnNameUC)) 02391 return i + 1; 02392 } 02393 throw new java.sql.SQLException("Column '" + columnName + "' not found."); 02394 } 02395 }

boolean org.objectweb.cjdbc.driver.DriverResultSet.first  )  throws SQLException
 

JDBC 2.0

Moves to the first row in the result set.

戻り値:
true if on a valid row, false if no rows in the result set.
例外:
SQLException if a database-access error occurs, or result set type is TYPE_FORWARD_ONLY.
DriverResultSet.java335 行で定義されています。

参照先 org.objectweb.cjdbc.driver.DriverResultSet.checkIfClosed(), org.objectweb.cjdbc.driver.DriverResultSet.currentRow, と org.objectweb.cjdbc.driver.DriverResultSet.nbOfRows.

参照元 org.objectweb.cjdbc.driver.DriverResultSet.absolute().

00336 { 00337 checkIfClosed(); 00338 if (nbOfRows == 0) 00339 return false; 00340 00341 currentRow = 0; 00342 return true; 00343 }

java.sql.Array org.objectweb.cjdbc.driver.DriverResultSet.getArray String  colName  )  throws SQLException
 

JDBC 2.0 Get an array column.

引数:
colName the column name
戻り値:
an object representing an SQL array
例外:
SQLException if a database-access error occurs.
DriverResultSet.java1380 行で定義されています。

参照先 org.objectweb.cjdbc.driver.DriverResultSet.findColumn(), と org.objectweb.cjdbc.driver.DriverResultSet.getArray().

01381 { 01382 return getArray(findColumn(colName)); 01383 }

java.sql.Array org.objectweb.cjdbc.driver.DriverResultSet.getArray int  columnIndex  )  throws SQLException
 

JDBC 2.0 Gets an array column.

引数:
columnIndex the first column is 1, the second is 2, ...
戻り値:
an object representing an SQL array
例外:
SQLException if a database-access error occurs.
DriverResultSet.java1311 行で定義されています。

参照先 org.objectweb.cjdbc.driver.DriverResultSet.checkRowAndColPosAndSetNullFlag(), org.objectweb.cjdbc.driver.DriverResultSet.currentRow, org.objectweb.cjdbc.driver.DriverResultSet.data, と org.objectweb.cjdbc.driver.DriverResultSet.wasNullFlag.

参照元 org.objectweb.cjdbc.driver.DriverResultSet.getArray().

01312 { 01313 checkRowAndColPosAndSetNullFlag(columnIndex); 01314 01315 if (wasNullFlag) 01316 return null; 01317 01318 return (java.sql.Array) (((Object[]) data.get(currentRow))[columnIndex - 1]); 01319 }

InputStream org.objectweb.cjdbc.driver.DriverResultSet.getAsciiStream String  columnName  )  throws SQLException
 

参照:
java.sql.ResultSet#getAsciiStream(java.lang.String)
DriverResultSet.java1022 行で定義されています。

参照先 org.objectweb.cjdbc.driver.DriverResultSet.findColumn(), と org.objectweb.cjdbc.driver.DriverResultSet.getAsciiStream().

01023 { 01024 return getAsciiStream(findColumn(columnName)); 01025 }

InputStream org.objectweb.cjdbc.driver.DriverResultSet.getAsciiStream int  columnIndex  )  throws SQLException
 

A column value can be retrieved as a stream of ASCII characters and then read in chunks from the stream. This method is particulary suitable for retrieving large LONGVARCHAR values. The JDBC driver will do any necessary conversion from the database format into ASCII.

Note: All the data in the returned stream must be read prior to getting the value of any other column. The next call to a get method implicitly closes the stream. Also, a stream may return 0 for available() whether there is data available or not.

引数:
columnIndex the first column is 1, the second is 2, ...
戻り値:
a Java InputStream that delivers the database column value as a stream of one byte ASCII characters. If the value is SQL NULL then the result is null
例外:
SQLException if a database access error occurs
参照:
getBinaryStream
DriverResultSet.java859 行で定義されています。

参照先 org.objectweb.cjdbc.driver.DriverResultSet.checkRowAndColPosAndSetNullFlag(), と org.objectweb.cjdbc.driver.DriverResultSet.getBinaryStream().

参照元 org.objectweb.cjdbc.driver.DriverResultSet.getAsciiStream().

00860 { 00861 checkRowAndColPosAndSetNullFlag(columnIndex); 00862 00863 return getBinaryStream(columnIndex); 00864 }

BigDecimal org.objectweb.cjdbc.driver.DriverResultSet.getBigDecimal String  columnName  )  throws SQLException
 

参照:
java.sql.ResultSet#getBigDecimal(java.lang.String)
DriverResultSet.java1236 行で定義されています。

参照先 org.objectweb.cjdbc.driver.DriverResultSet.findColumn(), と org.objectweb.cjdbc.driver.DriverResultSet.getBigDecimal().

01237 { 01238 return getBigDecimal(findColumn(columnName)); 01239 }

BigDecimal org.objectweb.cjdbc.driver.DriverResultSet.getBigDecimal int  columnIndex  )  throws SQLException
 

JDBC 2.0 Get the value of a column in the current row as a java.math.BigDecimal object.

引数:
columnIndex the first column is 1, the second is 2, ...
戻り値:
the column value (full precision); if the value is SQL NULL, the result is null
例外:
SQLException if a database-access error occurs.
DriverResultSet.java1174 行で定義されています。

参照先 org.objectweb.cjdbc.driver.DriverResultSet.checkRowAndColPosAndSetNullFlag(), org.objectweb.cjdbc.driver.DriverResultSet.currentRow, org.objectweb.cjdbc.driver.DriverResultSet.data, と org.objectweb.cjdbc.driver.DriverResultSet.wasNullFlag.

01175 { 01176 checkRowAndColPosAndSetNullFlag(columnIndex); 01177 01178 if (wasNullFlag) 01179 return null; 01180 else 01181 { 01182 Object obj = ((Object[]) data.get(currentRow))[columnIndex - 1]; 01183 if (obj instanceof BigDecimal) 01184 return (BigDecimal) obj; 01185 else if (obj instanceof Long) 01186 { 01187 return new BigDecimal(((Long) obj).longValue()); 01188 } 01189 else if (obj instanceof BigInteger) 01190 { 01191 return new BigDecimal(((BigInteger) obj)); 01192 } 01193 else if (obj instanceof Short) 01194 { 01195 return new BigDecimal(((Short) obj).shortValue()); 01196 } 01197 else if (obj instanceof Integer) 01198 { 01199 return new BigDecimal(((Integer) obj).intValue()); 01200 } 01201 else if (obj instanceof String) 01202 { 01203 return new BigDecimal((String) obj); 01204 } 01205 else if (obj instanceof Number) 01206 { 01207 // float and double have to be converted via string 01208 // othwerwise we produce errors 01209 // javadoc for BigDecimal : 01210 // Note: the results of this constructor can be somewhat unpredictable. 01211 // One might assume that new BigDecimal(.1) is exactly equal to .1, but 01212 // it is actually equal to 01213 // .1000000000000000055511151231257827021181583404541015625. This is so 01214 // because .1 cannot be represented exactly as a double (or, for that 01215 // matter, as a binary fraction of any finite length). Thus, the long 01216 // value that is being passed in to the constructor is not exactly equal 01217 // to .1, appearances nonwithstanding. 01218 01219 // The (String) constructor, on the other hand, is perfectly 01220 // predictable: new BigDecimal(".1") is exactly equal to .1, as one 01221 // would expect. Therefore, it is generally recommended that the 01222 // (String) constructor be used in preference to this one. 01223 return new BigDecimal(obj.toString()); 01224 } 01225 else 01226 { 01227 throw new SQLException("Type " + obj.getClass().getName() 01228 + " is not compatible with BigDecimal"); 01229 } 01230 } 01231 }

BigDecimal org.objectweb.cjdbc.driver.DriverResultSet.getBigDecimal String  columnName,
int  scale
throws SQLException
 

参照:
java.sql.ResultSet#getBigDecimal(String, int)
非推奨:
DriverResultSet.java981 行で定義されています。

参照先 org.objectweb.cjdbc.driver.DriverResultSet.findColumn(), と org.objectweb.cjdbc.driver.DriverResultSet.getBigDecimal().

00983 { 00984 return getBigDecimal(findColumn(columnName), scale); 00985 }

BigDecimal org.objectweb.cjdbc.driver.DriverResultSet.getBigDecimal int  columnIndex,
int  scale
throws SQLException
 

Get the value of a column in the current row as a java.lang.BigDecimal object

引数:
columnIndex the first column is 1, the second is 2...
scale the number of digits to the right of the decimal
戻り値:
the column value; if the value is SQL NULL, null
例外:
SQLException if a database access error occurs
非推奨:
DriverResultSet.java712 行で定義されています。

参照元 org.objectweb.cjdbc.driver.DriverResultSet.getBigDecimal().

00714 { 00715 BigDecimal bigDecimal = getBigDecimal(columnIndex); 00716 if (bigDecimal == null) 00717 return null; 00718 else 00719 return bigDecimal.setScale(scale); 00720 }

InputStream org.objectweb.cjdbc.driver.DriverResultSet.getBinaryStream String  columnName  )  throws SQLException
 

参照:
java.sql.ResultSet#getBinaryStream(java.lang.String)
DriverResultSet.java1039 行で定義されています。

参照先