Movatterモバイル変換


[0]ホーム

URL:


         


Interface RowSet

All Superinterfaces:
java.sql.ResultSet

public interfaceRowSet
extends java.sql.ResultSet

The RowSet interface adds support to the JDBC API for the JavaBeans(TM) component model. A rowset can be used as a JavaBean in a visual Bean development environment. A RowSet can be created and configured at design time and executed at runtime. The RowSet interface provides a set of JavaBeans properties that allow a RowSet instance to be configured to connect to a JDBC data source and read some data from the data source. A group of setXXX() methods provide a way to pass input parameters to a rowset. The RowSet interface supports JavaBeans events, allowing other components in an application to be notified when an important event on a rowset occurs, such as a change in its value.

The RowSet interface is unique in that it is intended to be implemented using the rest of the JDBC(TM) API. In other words, a RowSet implementation is a layer of software that executes "on top" of a JDBC driver. Implementations of the RowSet interface can be provided by anyone, including JDBC driver vendors who want to provide a RowSet implementation as part of their JDBC products.

Rowsets are easy to use. The RowSet interface extends the standard java.sql.ResultSet interface. The RowSetMetaData interface extends the java.sql.ResultSetMetaData interface. Thus, developers familiar with the JDBC API will have to learn a minimal number of new APIs to use rowsets. In addition, third-party software tools that work with JDBC ResultSets will also easily be made to work with rowsets.


Fields inherited from interface java.sql.ResultSet
CONCUR_READ_ONLY, CONCUR_UPDATABLE, FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE
 
addRowSetListener(RowSetListener listener)
          RowSet listener registration.
clearParameters()
          In general, parameter values remain in force for repeated use of a RowSet.
execute()
          Fills the rowset with data.
getCommand()
          Get the rowset's command property.
getDataSourceName()
          The JNDI name that identifies a JDBC data source.
getEscapeProcessing()
          If escape scanning is on (the default), the driver will do escape substitution before sending the SQL to the database.
getMaxFieldSize()
          The maxFieldSize limit (in bytes) is the maximum amount of data returned for any column value; it only applies to BINARY, VARBINARY, LONGVARBINARY, CHAR, VARCHAR, and LONGVARCHAR columns.
getMaxRows()
          The maxRows limit is the maximum number of rows that a RowSet can contain.
getPassword()
          The password used to create a database connection.
getQueryTimeout()
          The queryTimeout limit is the number of seconds the driver will wait for a Statement to execute.
getTransactionIsolation()
          The transaction isolation property contains the JDBC transaction isolation level used.
getTypeMap()
          Get the type-map object associated with this rowset.
getUrl()
          Get the url used to create a JDBC connection.
getUsername()
          The username used to create a database connection.
isReadOnly()
          A rowset may be read-only.
removeRowSetListener(RowSetListener listener)
          RowSet listener deregistration.
setArray(int i, java.sql.Array x)
          Set an Array parameter.
setAsciiStream(int parameterIndex, java.io.InputStream x, int length)
          When a very large ASCII value is input to a LONGVARCHAR parameter, it may be more practical to send it via a java.io.InputStream.
setBigDecimal(int parameterIndex, java.math.BigDecimal x)
          Set a parameter to a java.lang.BigDecimal value.
setBinaryStream(int parameterIndex, java.io.InputStream x, int length)
          When a very large binary value is input to a LONGVARBINARY parameter, it may be more practical to send it via a java.io.InputStream.
setBlob(int i, java.sql.Blob x)
          Set a BLOB parameter.
setBoolean(int parameterIndex, boolean x)
          Set a parameter to a Java boolean value.
setByte(int parameterIndex, byte x)
          Set a parameter to a Java byte value.
setBytes(int parameterIndex, byte[] x)
          Set a parameter to a Java array of bytes.
setCharacterStream(int parameterIndex, java.io.Reader reader, int length)
          When a very large UNICODE value is input to a LONGVARCHAR parameter, it may be more practical to send it via a java.io.Reader.
setClob(int i, java.sql.Clob x)
          Set a CLOB parameter.
setCommand(java.lang.String cmd)
          Set the rowset's command property.
setConcurrency(int concurrency)
          Set the rowset concurrency.
setDataSourceName(java.lang.String name)
          Set the data source name.
setDate(int parameterIndex, java.sql.Date x)
          Set a parameter to a java.sql.Date value.
setDate(int parameterIndex, java.sql.Date x, java.util.Calendar cal)
          Set a parameter to a java.sql.Date value.
setDouble(int parameterIndex, double x)
          Set a parameter to a Java double value.
setEscapeProcessing(boolean enable)
          If escape scanning is on (the default), the driver will do escape substitution before sending the SQL to the database.
setFloat(int parameterIndex, float x)
          Set a parameter to a Java float value.
setInt(int parameterIndex, int x)
          Set a parameter to a Java int value.
setLong(int parameterIndex, long x)
          Set a parameter to a Java long value.
setMaxFieldSize(int max)
          The maxFieldSize limit (in bytes) is set to limit the size of data that can be returned for any column value; it only applies to BINARY, VARBINARY, LONGVARBINARY, CHAR, VARCHAR, and LONGVARCHAR fields.
setMaxRows(int max)
          The maxRows limit is set to limit the number of rows that any RowSet can contain.
setNull(int parameterIndex, int sqlType)
          Set a parameter to SQL NULL.
setNull(int paramIndex, int sqlType, java.lang.String typeName)
          JDBC 2.0 Set a parameter to SQL NULL.
setObject(int parameterIndex, java.lang.Object x)
          Set the value of a parameter using an object; use the java.lang equivalent objects for integral values.
setObject(int parameterIndex, java.lang.Object x, int targetSqlType)
          This method is like setObject above, but the scale used is the scale of the second parameter.
setObject(int parameterIndex, java.lang.Object x, int targetSqlType, int scale)
          Set the value of a parameter using an object; use the java.lang equivalent objects for integral values.
setPassword(java.lang.String password)
          Set the password.
setQueryTimeout(int seconds)
          The queryTimeout limit is the number of seconds the driver will wait for a Statement to execute.
setReadOnly(boolean value)
          Set the read-onlyness of the rowset
setRef(int i, java.sql.Ref x)
          Set a REF(<structured-type>) parameter.
setShort(int parameterIndex, short x)
          Set a parameter to a Java short value.
setString(int parameterIndex, java.lang.String x)
          Set a parameter to a Java String value.
setTime(int parameterIndex, java.sql.Time x)
          Set a parameter to a java.sql.Time value.
setTime(int parameterIndex, java.sql.Time x, java.util.Calendar cal)
          Set a parameter to a java.sql.Time value.
setTimestamp(int parameterIndex, java.sql.Timestamp x)
          Set a parameter to a java.sql.Timestamp value.
setTimestamp(int parameterIndex, java.sql.Timestamp x, java.util.Calendar cal)
          Set a parameter to a java.sql.Timestamp value.
setTransactionIsolation(int level)
          Set the transaction isolation.
setType(int type)
          Set the rowset type.
setTypeMap(java.util.Map map)
          Install a type-map object as the default type-map for this rowset.
setUrl(java.lang.String url)
          Set the url used to create a connection.
setUsername(java.lang.String name)
          Set the user name.
 
Methods inherited from interface java.sql.ResultSet
absolute, afterLast, beforeFirst, cancelRowUpdates, clearWarnings, close, deleteRow, findColumn, first, getArray, getArray, getAsciiStream, getAsciiStream, getBigDecimal, getBigDecimal, getBigDecimal, getBigDecimal, getBinaryStream, getBinaryStream, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCharacterStream, getCharacterStream, getClob, getClob, getConcurrency, getCursorName, getDate, getDate, getDate, getDate, getDouble, getDouble, getFetchDirection, getFetchSize, getFloat, getFloat, getInt, getInt, getLong, getLong, getMetaData, getObject, getObject, getObject, getObject, getRef, getRef, getRow, getShort, getShort, getStatement, getString, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getType, getUnicodeStream, getUnicodeStream, getWarnings, insertRow, isAfterLast, isBeforeFirst, isFirst, isLast, last, moveToCurrentRow, moveToInsertRow, next, previous, refreshRow, relative, rowDeleted, rowInserted, rowUpdated, setFetchDirection, setFetchSize, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject, updateRow, updateShort, updateShort, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestamp, wasNull
 

getUrl

public java.lang.StringgetUrl()                        throws java.sql.SQLException
Get the url used to create a JDBC connection. The default value is null.
Returns:
a string url
Throws:
java.sql.SQLException - if a database-access error occurs.

setUrl

public voidsetUrl(java.lang.String url)            throws java.sql.SQLException
Set the url used to create a connection. Setting this property is optional. If a url is used, a JDBC driver that accepts the url must be loaded by the application before the rowset is used to connect to a database. The rowset will use the url internally to create a database connection when reading or writing data. Either a url or a data source name is used to create a connection, whichever was specified most recently.
Parameters:
url - a string value, may be null
Throws:
java.sql.SQLException - if a database-access error occurs.

getDataSourceName

public java.lang.StringgetDataSourceName()
The JNDI name that identifies a JDBC data source. Users should set either the url or data source name properties. The most recent property set is used to get a connection.
Returns:
a data source name

setDataSourceName

public voidsetDataSourceName(java.lang.String name)                       throws java.sql.SQLException
Set the data source name.
Parameters:
name - a data source name
Throws:
java.sql.SQLException - if a database-access error occurs.

getUsername

public java.lang.StringgetUsername()
The username used to create a database connection. The username property is set at runtime before calling execute(). It is not usually part of the serialized state of a rowset object.
Returns:
a user name

setUsername

public voidsetUsername(java.lang.String name)                 throws java.sql.SQLException
Set the user name.
Parameters:
name - a user name
Throws:
java.sql.SQLException - if a database-access error occurs.

getPassword

public java.lang.StringgetPassword()
The password used to create a database connection. The password property is set at runtime before calling execute(). It is not usually part of the serialized state of a rowset object.
Returns:
a password

setPassword

public voidsetPassword(java.lang.String password)                 throws java.sql.SQLException
Set the password.
Parameters:
password - the password string
Throws:
java.sql.SQLException - if a database-access error occurs.

getTransactionIsolation

public intgetTransactionIsolation()
The transaction isolation property contains the JDBC transaction isolation level used.
Returns:
the transaction isolation level

setTransactionIsolation

public voidsetTransactionIsolation(int level)                             throws java.sql.SQLException
Set the transaction isolation.
Parameters:
level - the transaction isolation level
Throws:
java.sql.SQLException - if a database-access error occurs.

getTypeMap

public java.util.MapgetTypeMap()                         throws java.sql.SQLException
Get the type-map object associated with this rowset. By default, the map returned is empty.
Returns:
a map object
Throws:
java.sql.SQLException - if a database-access error occurs.

setTypeMap

public voidsetTypeMap(java.util.Map map)                throws java.sql.SQLException
Install a type-map object as the default type-map for this rowset.
Parameters:
map - a map object
Throws:
java.sql.SQLException - if a database-access error occurs.

getCommand

public java.lang.StringgetCommand()
Get the rowset's command property. The command property contains a command string that can be executed to fill the rowset with data. The default value is null.
Returns:
the command string, may be null

setCommand

public voidsetCommand(java.lang.String cmd)                throws java.sql.SQLException
Set the rowset's command property. This property is optional. The command property may not be needed when a rowset is produced by a data source that doesn't support commands, such as a spreadsheet.
Parameters:
cmd - a command string, may be null
Throws:
java.sql.SQLException - if a database-access error occurs.

isReadOnly

public booleanisReadOnly()
A rowset may be read-only. Attempts to update a read-only rowset will result in an SQLException being thrown. Rowsets are updateable, by default, if updates are possible.
Returns:
true if updatable, false otherwise

setReadOnly

public voidsetReadOnly(boolean value)                 throws java.sql.SQLException
Set the read-onlyness of the rowset
Parameters:
value - true if read-only, false otherwise
Throws:
java.sql.SQLException - if a database-access error occurs.

getMaxFieldSize

public intgetMaxFieldSize()                    throws java.sql.SQLException
The maxFieldSize limit (in bytes) is the maximum amount of data returned for any column value; it only applies to BINARY, VARBINARY, LONGVARBINARY, CHAR, VARCHAR, and LONGVARCHAR columns. If the limit is exceeded, the excess data is silently discarded.
Returns:
the current max column size limit; zero means unlimited
Throws:
java.sql.SQLException - if a database-access error occurs.

setMaxFieldSize

public voidsetMaxFieldSize(int max)                     throws java.sql.SQLException
The maxFieldSize limit (in bytes) is set to limit the size of data that can be returned for any column value; it only applies to BINARY, VARBINARY, LONGVARBINARY, CHAR, VARCHAR, and LONGVARCHAR fields. If the limit is exceeded, the excess data is silently discarded. For maximum portability use values greater than 256.
Parameters:
max - the new max column size limit; zero means unlimited
Throws:
java.sql.SQLException - if a database-access error occurs.

getMaxRows

public intgetMaxRows()               throws java.sql.SQLException
The maxRows limit is the maximum number of rows that a RowSet can contain. If the limit is exceeded, the excess rows are silently dropped.
Returns:
the current max row limit; zero means unlimited
Throws:
java.sql.SQLException - if a database-access error occurs.

setMaxRows

public voidsetMaxRows(int max)                throws java.sql.SQLException
The maxRows limit is set to limit the number of rows that any RowSet can contain. If the limit is exceeded, the excess rows are silently dropped.
Parameters:
max - the new max rows limit; zero means unlimited
Throws:
java.sql.SQLException - if a database-access error occurs.

getEscapeProcessing

public booleangetEscapeProcessing()                            throws java.sql.SQLException
If escape scanning is on (the default), the driver will do escape substitution before sending the SQL to the database.
Returns:
true if enabled; false if disabled
Throws:
java.sql.SQLException - if a database-access error occurs.

setEscapeProcessing

public voidsetEscapeProcessing(boolean enable)                         throws java.sql.SQLException
If escape scanning is on (the default), the driver will do escape substitution before sending the SQL to the database.
Parameters:
enable - true to enable; false to disable
Throws:
java.sql.SQLException - if a database-access error occurs.

getQueryTimeout

public intgetQueryTimeout()                    throws java.sql.SQLException
The queryTimeout limit is the number of seconds the driver will wait for a Statement to execute. If the limit is exceeded, a SQLException is thrown.
Returns:
the current query timeout limit in seconds; zero means unlimited
Throws:
java.sql.SQLException - if a database-access error occurs.

setQueryTimeout

public voidsetQueryTimeout(int seconds)                     throws java.sql.SQLException
The queryTimeout limit is the number of seconds the driver will wait for a Statement to execute. If the limit is exceeded, a SQLException is thrown.
Parameters:
seconds - the new query timeout limit in seconds; zero means unlimited
Throws:
java.sql.SQLException - if a database-access error occurs.

setType

public voidsetType(int type)             throws java.sql.SQLException
Set the rowset type.
Parameters:
type - a value from ResultSet.TYPE_XXX
Throws:
java.sql.SQLException - if a database-access error occurs.

setConcurrency

public voidsetConcurrency(int concurrency)                    throws java.sql.SQLException
Set the rowset concurrency.
Parameters:
concurrency - a value from ResultSet.CONCUR_XXX
Throws:
java.sql.SQLException - if a database-access error occurs.

setNull

public voidsetNull(int parameterIndex,                    int sqlType)             throws java.sql.SQLException
Set a parameter to SQL NULL.

Note: You must specify the parameter's SQL type.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
sqlType - SQL type code defined by java.sql.Types
Throws:
java.sql.SQLException - if a database-access error occurs.

setNull

public voidsetNull(int paramIndex,                    int sqlType,                    java.lang.String typeName)             throws java.sql.SQLException
JDBC 2.0 Set a parameter to SQL NULL. This version of setNull should be used for user-named types and REF type parameters. Examples of user-named types include: STRUCT, DISTINCT, JAVA_OBJECT, and named array types.

Note: To be portable, applications must give the SQL type code and the fully qualified SQL type name when specifying a NULL user-named or REF parameter. In the case of a user-named type the name is the type name of the parameter itself. For a REF parameter the name is the type name of the referenced type. If a JDBC driver does not need the type code or type name information, it may ignore it. Although it is intended for user-named and Ref parameters, this method may be used to set a null parameter of any JDBC type. If the parameter does not have a user-named or REF type then the typeName is ignored.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
sqlType - a value from java.sql.Types
typeName - the fully qualified name of a SQL user-named type, ignored if the parameter is not a user-named type or REF
Throws:
java.sql.SQLException - if a database-access error occurs.

setBoolean

public voidsetBoolean(int parameterIndex,                       boolean x)                throws java.sql.SQLException
Set a parameter to a Java boolean value.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws:
java.sql.SQLException - if a database-access error occurs.

setByte

public voidsetByte(int parameterIndex,                    byte x)             throws java.sql.SQLException
Set a parameter to a Java byte value.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws:
java.sql.SQLException - if a database-access error occurs.

setShort

public voidsetShort(int parameterIndex,                     short x)              throws java.sql.SQLException
Set a parameter to a Java short value.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws:
java.sql.SQLException - if a database-access error occurs.

setInt

public voidsetInt(int parameterIndex,                   int x)            throws java.sql.SQLException
Set a parameter to a Java int value.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws:
java.sql.SQLException - if a database-access error occurs.

setLong

public voidsetLong(int parameterIndex,                    long x)             throws java.sql.SQLException
Set a parameter to a Java long value.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws:
java.sql.SQLException - if a database-access error occurs.

setFloat

public voidsetFloat(int parameterIndex,                     float x)              throws java.sql.SQLException
Set a parameter to a Java float value. The driver converts this to a SQL FLOAT value when it sends it to the database.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws:
java.sql.SQLException - if a database-access error occurs.

setDouble

public voidsetDouble(int parameterIndex,                      double x)               throws java.sql.SQLException
Set a parameter to a Java double value.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws:
java.sql.SQLException - if a database-access error occurs.

setBigDecimal

public voidsetBigDecimal(int parameterIndex,                          java.math.BigDecimal x)                   throws java.sql.SQLException
Set a parameter to a java.lang.BigDecimal value.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws:
java.sql.SQLException - if a database-access error occurs.

setString

public voidsetString(int parameterIndex,                      java.lang.String x)               throws java.sql.SQLException
Set a parameter to a Java String value.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws:
java.sql.SQLException - if a database-access error occurs.

setBytes

public voidsetBytes(int parameterIndex,                     byte[] x)              throws java.sql.SQLException
Set a parameter to a Java array of bytes.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws:
java.sql.SQLException - if a database-access error occurs.

setDate

public voidsetDate(int parameterIndex,                    java.sql.Date x)             throws java.sql.SQLException
Set a parameter to a java.sql.Date value.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws:
java.sql.SQLException - if a database-access error occurs.

setTime

public voidsetTime(int parameterIndex,                    java.sql.Time x)             throws java.sql.SQLException
Set a parameter to a java.sql.Time value.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws:
java.sql.SQLException - if a database-access error occurs.

setTimestamp

public voidsetTimestamp(int parameterIndex,                         java.sql.Timestamp x)                  throws java.sql.SQLException
Set a parameter to a java.sql.Timestamp value.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws:
java.sql.SQLException - if a database-access error occurs.

setAsciiStream

public voidsetAsciiStream(int parameterIndex,                           java.io.InputStream x,                           int length)                    throws java.sql.SQLException
When a very large ASCII value is input to a LONGVARCHAR parameter, it may be more practical to send it via a java.io.InputStream. JDBC will read the data from the stream as needed, until it reaches end-of-file.

Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the java input stream which contains the ASCII parameter value
length - the number of bytes in the stream
Throws:
java.sql.SQLException - if a database-access error occurs.

setBinaryStream

public voidsetBinaryStream(int parameterIndex,                            java.io.InputStream x,                            int length)                     throws java.sql.SQLException
When a very large binary value is input to a LONGVARBINARY parameter, it may be more practical to send it via a java.io.InputStream. JDBC will read the data from the stream as needed, until it reaches end-of-file.

Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the java input stream which contains the binary parameter value
length - the number of bytes in the stream
Throws:
java.sql.SQLException - if a database-access error occurs.

setCharacterStream

public voidsetCharacterStream(int parameterIndex,                               java.io.Reader reader,                               int length)                        throws java.sql.SQLException
When a very large UNICODE value is input to a LONGVARCHAR parameter, it may be more practical to send it via a java.io.Reader. JDBC will read the data from the stream as needed, until it reaches end-of-file.

Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the java reader which contains the UNICODE data
length - the number of characters in the stream
Throws:
java.sql.SQLException - if a database-access error occurs.

setObject

public voidsetObject(int parameterIndex,                      java.lang.Object x,                      int targetSqlType,                      int scale)               throws java.sql.SQLException

Set the value of a parameter using an object; use the java.lang equivalent objects for integral values.

The given Java object will be converted to the targetSqlType before being sent to the database. If the object is of a class implementing SQLData, the rowset should call its method writeSQL() to write it to the SQL data stream. else If the object is of a class implementing Ref, Blob, Clob, Struct, or Array then pass it to the database as a value of the corresponding SQL type.

Note that this method may be used to pass datatabase- specific abstract data types.

Parameters:
parameterIndex - The first parameter is 1, the second is 2, ...
x - The object containing the input parameter value
targetSqlType - The SQL type (as defined in java.sql.Types) to be sent to the database. The scale argument may further qualify this type.
scale - For java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types this is the number of digits after the decimal. For all other types this value will be ignored,
Throws:
java.sql.SQLException - if a database-access error occurs.
See Also:
Types

setObject

public voidsetObject(int parameterIndex,                      java.lang.Object x,                      int targetSqlType)               throws java.sql.SQLException
This method is like setObject above, but the scale used is the scale of the second parameter. Scalar values have a scale of zero. Literal values have the scale present in the literal. While it is supported, it is not recommended that this method not be called with floating point input values.
Throws:
java.sql.SQLException - if a database-access error occurs.

setObject

public voidsetObject(int parameterIndex,                      java.lang.Object x)               throws java.sql.SQLException

Set the value of a parameter using an object; use the java.lang equivalent objects for integral values.

The JDBC specification specifies a standard mapping from Java Object types to SQL types. The given argument java object will be converted to the corresponding SQL type before being sent to the database.

Note that this method may be used to pass datatabase specific abstract data types, by using a Driver specific Java type. If the object is of a class implementing SQLData, the rowset should call its method writeSQL() to write it to the SQL data stream. else If the object is of a class implementing Ref, Blob, Clob, Struct, or Array then pass it to the database as a value of the corresponding SQL type. Raise an exception if there is an ambiguity, for example, if the object is of a class implementing more than one of those interfaces.

Parameters:
parameterIndex - The first parameter is 1, the second is 2, ...
x - The object containing the input parameter value
Throws:
java.sql.SQLException - if a database-access error occurs.

setRef

public voidsetRef(int i,                   java.sql.Ref x)            throws java.sql.SQLException
Set a REF(<structured-type>) parameter.
Parameters:
i - the first parameter is 1, the second is 2, ...
x - an object representing data of an SQL REF Type

setBlob

public voidsetBlob(int i,                    java.sql.Blob x)             throws java.sql.SQLException
Set a BLOB parameter.
Parameters:
i - the first parameter is 1, the second is 2, ...
x - an object representing a BLOB

setClob

public voidsetClob(int i,                    java.sql.Clob x)             throws java.sql.SQLException
Set a CLOB parameter.
Parameters:
i - the first parameter is 1, the second is 2, ...
x - an object representing a CLOB

setArray

public voidsetArray(int i,                     java.sql.Array x)              throws java.sql.SQLException
Set an Array parameter.
Parameters:
i - the first parameter is 1, the second is 2, ...
x - an object representing an SQL array

setDate

public voidsetDate(int parameterIndex,                    java.sql.Date x,                    java.util.Calendar cal)             throws java.sql.SQLException
Set a parameter to a java.sql.Date value. The driver converts this to a SQL DATE value when it sends it to the database.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws:
java.sql.SQLException - if a database-access error occurs.

setTime

public voidsetTime(int parameterIndex,                    java.sql.Time x,                    java.util.Calendar cal)             throws java.sql.SQLException
Set a parameter to a java.sql.Time value. The driver converts this to a SQL TIME value when it sends it to the database.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws:
java.sql.SQLException - if a database-access error occurs.

setTimestamp

public voidsetTimestamp(int parameterIndex,                         java.sql.Timestamp x,                         java.util.Calendar cal)                  throws java.sql.SQLException
Set a parameter to a java.sql.Timestamp value. The driver converts this to a SQL TIMESTAMP value when it sends it to the database.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws:
java.sql.SQLException - if a database-access error occurs.

clearParameters

public voidclearParameters()                     throws java.sql.SQLException

In general, parameter values remain in force for repeated use of a RowSet. Setting a parameter value automatically clears its previous value. However, in some cases it is useful to immediately release the resources used by the current parameter values; this can be done by calling clearParameters.

Throws:
java.sql.SQLException - if a database-access error occurs.

execute

public voidexecute()             throws java.sql.SQLException
Fills the rowset with data. Execute() may use the following properties: url, data source name, user name, password, transaction isolation, and type map to create a connection for reading data. Execute may use the following properties to create a statement to execute a command: command, read only, maximum field size, maximum rows, escape processing, and query timeout. If the required properties have not been set, an exception is thrown. If successful, the current contents of the rowset are discarded and the rowset's metadata is also (re)set. If there are outstanding updates, they are ignored.
Throws:
java.sql.SQLException - if a database-access error occurs.

addRowSetListener

public voidaddRowSetListener(RowSetListener listener)
RowSet listener registration. Listeners are notified when an event occurs.
Parameters:
listener - an event listener

removeRowSetListener

public voidremoveRowSetListener(RowSetListener listener)
RowSet listener deregistration.
Parameters:
listener - an event listener

         


[8]ページ先頭

©2009-2025 Movatter.jp