• Topic
  • Discussion
  • UdaWikiWeb.ClassBaseRowSet(Last) -- Owiki? , 2016-08-19 14:59:41 Edit owiki 2016-08-19 14:59:41

    Class BaseRowSet

    BaseRowSet Classes BaseRowSet

    Synopsis

    abstract public class BaseRowSet implements RowSet,Serializable {
      // Public Constructors
      public BaseRowSet();
      // Public Methods
      public void close() throws java.sql.SQLException;
      public void addRowSetListener(javax.sql.RowSetListener rowsetlistener);
      public void removeRowSetListener(javax.sql.RowSetListener rowsetlistener);
      public void clearParameters() throws java.sql.SQLException;
      public String getCommand();
      public int getConcurrency() throws java.sql.SQLException;
      public String getDataSourceName();
      public boolean getEscapeProcessing() throws java.sql.SQLException;
      public int getFetchDirection() throws java.sql.SQLException;
      public int getFetchSize() throws java.sql.SQLException;
      public int getMaxFieldSize() throws java.sql.SQLException;
      public int getMaxRows() throws java.sql.SQLException;
      public Object[] getParams() throws java.sql.SQLException;
      public String getPassword();
      public int getQueryTimeout() throws java.sql.SQLException;
      public int getTransactionIsolation();
      public int getType() throws java.sql.SQLException;
      public Map getTypeMap() throws java.sql.SQLException;
      public String getUrl() throws java.sql.SQLException;
      public String getUsername();
      public boolean isReadOnly();
      public void setArray(int parameterIndex, java.sql.Array x) 
          throws java.sql.SQLException;
      public void setAsciiStream(int parameterIndex, java.io.InputStream x, 
                                 int length) throws java.sql.SQLException;
      public void setBigDecimal(int parameterIndex, java.math.BigDecimal x) 
          throws java.sql.SQLException;
      public void setBinaryStream(int parameterIndex, java.io.InputStream x, 
                                  int length) throws java.sql.SQLException;
      public void setBlob(int parameterIndex, java.sql.Blob x) 
          throws java.sql.SQLException;
      public void setBoolean(int parameterIndex, boolean x) 
          throws java.sql.SQLException;
      public void setByte(int parameterIndex, byte x) throws java.sql.SQLException;
      public void setBytes(int parameterIndex, byte[] x) 
          throws java.sql.SQLException;
      public void setCharacterStream(int parameterIndex, java.io.Reader x, 
                                     int length) throws java.sql.SQLException;
      public void setClob(int parameterIndex, java.sql.Clob x) 
          throws java.sql.SQLException;
      public void setDate(int parameterIndex, java.sql.Date x) 
          throws java.sql.SQLException;
      public void setDate(int parameterIndex, java.sql.Date x, 
                          java.util.Calendar cal) throws java.sql.SQLException;
      public void setDouble(int parameterIndex, double x) 
          throws java.sql.SQLException;
      public void setFloat(int parameterIndex, float x) 
          throws java.sql.SQLException;
      public void setInt(int parameterIndex, int x) throws java.sql.SQLException;
      public void setLong(int parameterIndex, long x) throws java.sql.SQLException;
      public void setRef(int parameterIndex, java.sql.Ref x) 
          throws java.sql.SQLException;
      public void setShort(int parameterIndex, short x) 
          throws java.sql.SQLException;
      public void setString(int parameterIndex, java.lang.String x) 
          throws java.sql.SQLException;
      public void setTime(int parameterIndex, java.sql.Time x) 
          throws java.sql.SQLException;
      public void setTime(int parameterIndex, java.sql.Time x, 
                          java.util.Calendar cal) throws java.sql.SQLException;
      public void setTimestamp(int parameterIndex, java.sql.Timestamp x) 
          throws java.sql.SQLException;
      public void setTimestamp(int parameterIndex, java.sql.Timestamp x, 
                               java.util.Calendar cal) 
          throws java.sql.SQLException;
      public void setUnicodeStream(int parameterIndex, java.io.InputStream x, 
                                   int length) throws java.sql.SQLException;
      public void setNull(int parameterIndex, int sqlType) 
          throws java.sql.SQLException;
      public void setNull(int parameterIndex, int sqlType, 
                          java.lang.String typeName) throws java.sql.SQLException;
      public void setObject(int parameterIndex, java.lang.Object x) 
          throws java.sql.SQLException;
      public void setObject(int parameterIndex, java.lang.Object x, 
                            int targetSqlType) throws java.sql.SQLException;
      public void setObject(int parameterIndex, java.lang.Object x, 
                            int targetSqlType, int scale) 
          throws java.sql.SQLException;
      public void setCommand(java.lang.String s) throws java.sql.SQLException;
      public void setConcurrency(int i) throws java.sql.SQLException;
      public void setDataSourceName(java.lang.String s) 
          throws java.sql.SQLException;
      public void setEscapeProcessing(boolean flag) throws java.sql.SQLException;
      public void setFetchDirection(int direction) throws java.sql.SQLException;
      public void setFetchSize(int rows) throws java.sql.SQLException;
      public void setMaxFieldSize(int max) throws java.sql.SQLException;
      public void setMaxRows(int max) throws java.sql.SQLException;
      public void setQueryTimeout(int seconds) throws java.sql.SQLException;
      public void setReadOnly(boolean value) throws java.sql.SQLException;
      public void setPassword(java.lang.String s) throws java.sql.SQLException;
      public void setTransactionIsolation(int value) throws java.sql.SQLException;
      public void setType(int value) throws java.sql.SQLException;
      public void setTypeMap(java.util.Map value) throws java.sql.SQLException;
      public void setUrl(java.lang.String s) throws java.sql.SQLException;
      public void setUsername(java.lang.String s) throws java.sql.SQLException;
    }
    
    


    Inheritance Path
    java.lang.Object


    openlink.javax.BaseRowSet

    Members

    Method addRowSetListener(RowSetListener)

    addRowSetListener Methods addRowSetListener
    Synopsis: public void addRowSetListener(
    javax.sql.RowSetListener rowsetlistener);

    Parameters

    • listener - an event listener

    RowSet listener registration. Listeners are notified when an event occurs.

    Method clearParameters()

    clearParameters Methods clearParameters

    Synopsis: public void clearParameters() throws java.sql.SQLException;

    Exceptions

    SQLException

    if a database-access error occurs.

    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.

    Method getCommand()

    getCommand Methods getCommand
    Synopsis: public String getCommand();

    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.

    Method getConcurrency()

    getConcurrency Methods getConcurrency
    Synopsis: public int getConcurrency() throws java.sql.SQLException;

    Exceptions

    SQLException

    if a database-access error occurs.

    Get the rowset concurrency.

    Method getDataSourceName()

    getDataSourceName Methods getDataSourceName
    Synopsis: public String getDataSourceName();

    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.

    Method getEscapeProcessing()

    getEscapeProcessing Methods getEscapeProcessing
    Synopsis: public boolean getEscapeProcessing() throws java.sql.SQLException;

    Exceptions

    SQLException

    if a database-access error occurs.

    If escape scanning is on (the default), the driver will do escape substitution before sending the SQL to the database.

    Method getFetchDirection()

    getFetchDirection Methods getFetchDirection
    Synopsis: public int getFetchDirection() throws java.sql.SQLException;

    Exceptions

    SQLException

    if a database-access error occurs

    Determine the fetch direction.

    Method getFetchSize()
    getFetchSize Methods getFetchSize
    Synopsis: public int getFetchSize() throws java.sql.SQLException;

    Determine the default fetch size.

    Method getMaxFieldSize()

    getMaxFieldSize Methods getMaxFieldSize
    Synopsis: public int getMaxFieldSize() throws java.sql.SQLException;

    Exceptions

    SQLException

    if a database-access error occurs.

    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.

    Method getMaxRows()

    getMaxRows Methods getMaxRows
    Synopsis: public int getMaxRows() throws java.sql.SQLException;

    Exceptions

    SQLException

    if a database-access error occurs.

    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.

    Method getParams()

    getParams Methods getParams
    Synopsis: public Object[] getParams() throws java.sql.SQLException;

    Exceptions

    SQLException

    if a database-access error occurs.

    Get the parameters that were set on the rowset.

    1.2.12. Method getPassword()
    getPassword Methods getPassword

    Synopsis: public String getPassword();


    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.

    1.2.13. Method getQueryTimeout()
    getQueryTimeout Methods getQueryTimeout

    Synopsis: public int getQueryTimeout() throws java.sql.SQLException;


    Exceptions

    SQLException

    if a database-access error occurs.

    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.

    Method getTransactionIsolation()

    getTransactionIsolation Methods getTransactionIsolation
    Synopsis: public int getTransactionIsolation();

    The transaction isolation property contains the JDBC transaction isolation level used.

    Method getType()

    getType Methods getType
    Synopsis: public int getType() throws java.sql.SQLException;

    Exceptions

    SQLException

    if a database-access error occurs

    Return the type of this result set.

    Method getTypeMap()

    getTypeMap Methods getTypeMap
    Synopsis: public Map getTypeMap() throws java.sql.SQLException;

    Exceptions

    SQLException

    if a database-access error occurs.

    Get the type-map object associated with this rowset. By default, the map returned is empty.

    Method getUrl()

    getUrl Methods getUrl
    Synopsis: public String getUrl() throws java.sql.SQLException;

    Exceptions

    SQLException

    if a database-access error occurs.

    Get the url used to create a JDBC connection. The default value is null.

    Method getUsername()

    getUsername Methods getUsername
    Synopsis: public String getUsername();

    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.

    Method isReadOnly()

    isReadOnly Methods isReadOnly
    Synopsis: public boolean isReadOnly();

    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.

    Method removeRowSetListener(RowSetListener)

    removeRowSetListener Methods removeRowSetListener
    Synopsis: public void removeRowSetListener(
    javax.sql.RowSetListener rowsetlistener);

    Parameters

    • listener - an event listener

    RowSet listener deregistration.

    Method setArray(int, Array)

    setArray Methods setArray
    Synopsis: public void setArray(int parameterIndex, java.sql.Array x)
    throws java.sql.SQLException;

    Parameters

    • i - the first parameter is 1, the second is 2, ...
    • x - an object representing an SQL array

    Set an Array parameter.

    Method setAsciiStream(int, InputStream, int)

    setAsciiStream Methods setAsciiStream
    Synopsis: public void setAsciiStream(int parameterIndex, java.io.InputStream x,
    int length)
    throws java.sql.SQLException;

    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

    Exceptions

    SQLException

    if a database-access error occurs.

    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.

    Method setBigDecimal(int, BigDecimal)

    setBigDecimal Methods setBigDecimal
    Synopsis: public void setBigDecimal(int parameterIndex, java.math.BigDecimal x)
    throws java.sql.SQLException;

    Parameters

    • parameterIndex - the first parameter is 1, the second is 2, ...
    • x - the parameter value

    Exceptions

    SQLException

    if a database-access error occurs.

    Set a parameter to a java.lang.BigDecimal value.

    Method setBinaryStream(int, InputStream, int)

    setBinaryStream Methods setBinaryStream
    Synopsis: public void setBinaryStream(int parameterIndex,
    java.io.InputStream x, int length)
    throws java.sql.SQLException;

    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

    Exceptions

    SQLException

    if a database-access error occurs.

    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.

    Method setBlob(int, Blob)

    setBlob Methods setBlob
    Synopsis: public void setBlob(int parameterIndex, java.sql.Blob x)
    throws java.sql.SQLException;

    Parameters

    • i - the first parameter is 1, the second is 2, ...
    • x - an object representing a BLOB

    Set a BLOB parameter.

    Method setBoolean(int, boolean)

    setBoolean Methods setBoolean
    Synopsis: public void setBoolean(int parameterIndex, boolean x)
    throws java.sql.SQLException;

    Parameters

    • parameterIndex - the first parameter is 1, the second is 2, ...
    • x - the parameter value

    Exceptions

    SQLException

    if a database-access error occurs.

    Set a parameter to a Java boolean value.

    Method setByte(int, byte)

    setByte Methods setByte
    Synopsis: public void setByte(int parameterIndex, byte x)
    throws java.sql.SQLException;

    Parameters

    • parameterIndex - the first parameter is 1, the second is 2, ...
    • x - the parameter value

    Exceptions

    SQLException

    if a database-access error occurs.

    Set a parameter to a Java byte value.

    Method setBytes(int, byte[])

    setBytes Methods setBytes
    Synopsis: public void setBytes(int parameterIndex, byte[] x)
    throws java.sql.SQLException;

    Parameters

    • parameterIndex - the first parameter is 1, the second is 2, ...
    • x - the parameter value

    Exceptions

    SQLException

    if a database-access error occurs.

    Set a parameter to a Java array of bytes.

    Method setCharacterStream(int, Reader, int)

    setCharacterStream Methods setCharacterStream
    Synopsis: public void setCharacterStream(int parameterIndex, java.io.Reader x,
    int length)
    throws java.sql.SQLException;

    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

    Exceptions

    SQLException

    if a database-access error occurs.

    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.

    Method setClob(int, Clob)

    setClob Methods setClob
    Synopsis: public void setClob(int parameterIndex, java.sql.Clob x)
    throws java.sql.SQLException;

    Parameters

    • i - the first parameter is 1, the second is 2, ...
    • x - an object representing a CLOB

    Set a CLOB parameter.

    Method setCommand(String)

    setCommand Methods setCommand
    Synopsis: public void setCommand(java.lang.String s)
    throws java.sql.SQLException;

    Parameters

    • cmd - a command string, may be null

    Exceptions

    SQLException

    if a database-access error occurs.

    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.

    Method setConcurrency(int)

    setConcurrency Methods setConcurrency
    Synopsis: public void setConcurrency(int i) throws java.sql.SQLException;

    Parameters

    • concurrency - a value from ResultSet.CONCUR_XXX

    Exceptions

    SQLException

    if a database-access error occurs.

    Set the rowset concurrency.

    Method setDataSourceName(String)

    setDataSourceName Methods setDataSourceName
    Synopsis: public void setDataSourceName(java.lang.String s)
    throws java.sql.SQLException;

    Parameters

    • name - a data source name

    Exceptions

    SQLException

    if a database-access error occurs.

    Set the data source name.

    Method setDate(int, Date)

    setDate Methods setDate
    Synopsis: public void setDate(int parameterIndex, java.sql.Date x)
    throws java.sql.SQLException;

    Parameters

    • parameterIndex - the first parameter is 1, the second is 2, ...
    • x - the parameter value

    Exceptions

    SQLException

    if a database-access error occurs.

    Set a parameter to a java.sql.Date value.

    Method setDate(int, Date, Calendar)

    setDate Methods setDate
    Synopsis: public void setDate(int parameterIndex, java.sql.Date x,
    java.util.Calendar cal)
    throws java.sql.SQLException;

    Parameters

    • parameterIndex - the first parameter is 1, the second is 2, ...
    • x - the parameter value

    Exceptions

    SQLException

    if a database-access error occurs.

    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.

    Method setDouble(int, double)

    setDouble Methods setDouble
    Synopsis: public void setDouble(int parameterIndex, double x)
    throws java.sql.SQLException;

    Parameters

    • parameterIndex - the first parameter is 1, the second is 2, ...
    • x - the parameter value

    Exceptions

    SQLException

    if a database-access error occurs.

    Set a parameter to a Java double value.

    Method setEscapeProcessing(boolean)

    setEscapeProcessing Methods setEscapeProcessing
    Synopsis: public void setEscapeProcessing(boolean flag)
    throws java.sql.SQLException;

    Parameters

    • enable - true to enable; false to disable

    Exceptions

    SQLException

    if a database-access error occurs.

    If escape scanning is on (the default), the driver will do escape substitution before sending the SQL to the database.

    Method setFetchDirection(int)

    setFetchDirection Methods setFetchDirection
    Synopsis: public void setFetchDirection(int direction)
    throws java.sql.SQLException;

    Exceptions

    SQLException

    if a database-access error occurs, or the result set type is TYPE_FORWARD_ONLY and direction is not FETCH_FORWARD.

    Give a hint as to the direction in which the rows in this result set will be processed. The initial value is determined by the statement that produced the result set. The fetch direction may be changed at any time.

    Method setFetchSize(int)

    setFetchSize Methods setFetchSize
    Synopsis: public void setFetchSize(int rows) throws java.sql.SQLException;

    Parameters

    • rows - the number of rows to fetch

    Exceptions

    SQLException

    if a database-access error occurs, or the condition 0 <

    rows <

    this.getMaxRows() is not satisfied.

    Give the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed for this result set. If the fetch size specified is zero, then the JDBC driver ignores the value, and is free to make its own best guess as to what the fetch size should be. The default value is set by the statement that creates the result set. The fetch size may be changed at any time.
    Method setFloat(int, float)

    setFloat Methods setFloat
    Synopsis: public void setFloat(int parameterIndex, float x)
    throws java.sql.SQLException;

    Parameters

    • parameterIndex - the first parameter is 1, the second is 2, ...
    • x - the parameter value

    Exceptions

    SQLException

    if a database-access error occurs.

    Set a parameter to a Java float value. The driver converts this to a SQL FLOAT value when it sends it to the database.

    Method setInt(int, int)

    setInt Methods setInt
    Synopsis: public void setInt(int parameterIndex, int x)
    throws java.sql.SQLException;

    Parameters

    • parameterIndex - the first parameter is 1, the second is 2, ...
    • x - the parameter value

    Exceptions

    SQLException

    if a database-access error occurs.

    Set a parameter to a Java int value.

    Method setLong(int, long)

    setLong Methods setLong
    Synopsis: public void setLong(int parameterIndex, long x)
    throws java.sql.SQLException;

    Parameters

    • parameterIndex - the first parameter is 1, the second is 2, ...
    • x - the parameter value

    Exceptions

    SQLException

    if a database-access error occurs.

    Set a parameter to a Java long value.

    Method setMaxFieldSize(int)

    setMaxFieldSize Methods setMaxFieldSize
    Synopsis: public void setMaxFieldSize(int max) throws java.sql.SQLException;

    Parameters

    • max - the new max column size limit; zero means unlimited

    Exceptions

    SQLException

    if a database-access error occurs.

    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.

    Method setMaxRows(int)

    setMaxRows Methods setMaxRows
    Synopsis: public void setMaxRows(int max) throws java.sql.SQLException;

    Parameters

    • max - the new max rows limit; zero means unlimited

    Exceptions

    SQLException

    if a database-access error occurs.

    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.

    Method setNull(int, int)

    setNull Methods setNull
    Synopsis: public void setNull(int parameterIndex, int sqlType)
    throws java.sql.SQLException;

    Parameters

    • parameterIndex - the first parameter is 1, the second is 2, ...
    • sqlType - SQL type code defined by java.sql.Types

    Exceptions

    SQLException

    if a database-access error occurs.

    Set a parameter to SQL NULL.

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

    Method setNull(int, int, String)

    setNull Methods setNull
    Synopsis: public void setNull(int parameterIndex, int sqlType,
    java.lang.String typeName)
    throws java.sql.SQLException;

    Parameters

    • parameterIndex - the first parameter is 1, the second is 2, ...
    • sqlType - a value from java.sql.Types
    • typeName - the fully-qualified name of an SQL user-named type, ignored if the parameter is not a user-named type or REF

    Exceptions

    SQLException

    if a database access error occurs

    Sets the designated 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-defined 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, the given typeName is ignored.

    Method setObject(int, Object)

    setObject Methods setObject
    Synopsis: public void setObject(int parameterIndex, java.lang.Object x)
    throws java.sql.SQLException;

    Parameters

    • parameterIndex - The first parameter is 1, the second is 2, ...
    • x - The object containing the input parameter value

    Exceptions

    SQLException

    if a database-access error occurs.

    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.

    Method setObject(int, Object, int)

    setObject Methods setObject
    Synopsis: public void setObject(int parameterIndex, java.lang.Object x,
    int targetSqlType)
    throws java.sql.SQLException;

    Exceptions

    SQLException

    if a database-access error occurs.

    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.

    Method setObject(int, Object, int, int)

    setObject Methods setObject
    Synopsis: public void setObject(int parameterIndex, java.lang.Object x,
    int targetSqlType, int scale)
    throws java.sql.SQLException;

    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,

    Exceptions

    SQLException

    if a database-access error occurs.

    Additional Information

    See Also

    • java.sql.Types


    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.

    Method setPassword(String)

    setPassword Methods setPassword
    Synopsis: public void setPassword(java.lang.String s)
    throws java.sql.SQLException;

    Parameters

    • password - the password string

    Exceptions

    SQLException

    if a database-access error occurs.

    Set the password.

    Method setQueryTimeout(int)

    setQueryTimeout Methods setQueryTimeout
    Synopsis: public void setQueryTimeout(int seconds)
    throws java.sql.SQLException;

    Parameters

    • seconds - the new query timeout limit in seconds; zero means unlimited

    Exceptions

    SQLException

    if a database-access error occurs.

    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.

    Method setReadOnly(boolean)

    setReadOnly Methods setReadOnly
    Synopsis: public void setReadOnly(boolean value) throws java.sql.SQLException;

    Parameters

    • value - true if read-only, false otherwise

    Exceptions

    SQLException

    if a database-access error occurs.

    Set the read-onlyness of the rowset

    Method setRef(int, Ref)

    setRef Methods setRef
    Synopsis: public void setRef(int parameterIndex, java.sql.Ref x)
    throws java.sql.SQLException;

    Parameters

    • i - the first parameter is 1, the second is 2, ...
    • x - an object representing data of an SQL REF Type

    Set a REF(<structured-type>) parameter.

    Method setShort(int, short)

    setShort Methods setShort
    Synopsis: public void setShort(int parameterIndex, short x)
    throws java.sql.SQLException;

    Parameters

    • parameterIndex - the first parameter is 1, the second is 2, ...
    • x - the parameter value

    Exceptions

    SQLException

    if a database-access error occurs.

    Set a parameter to a Java short value.

    Method setString(int, String)

    setString Methods setString
    Synopsis: public void setString(int parameterIndex, java.lang.String x)
    throws java.sql.SQLException;

    Parameters

    • parameterIndex - the first parameter is 1, the second is 2, ...
    • x - the parameter value

    Exceptions

    SQLException

    if a database-access error occurs.

    Set a parameter to a Java String value.

    Method setTime(int, Time)

    setTime Methods setTime
    Synopsis: public void setTime(int parameterIndex, java.sql.Time x)
    throws java.sql.SQLException;

    Parameters

    • parameterIndex - the first parameter is 1, the second is 2, ...
    • x - the parameter value

    Exceptions

    SQLException

    if a database-access error occurs.

    Set a parameter to a java.sql.Time value.

    Method setTime(int, Time, Calendar)

    setTime Methods setTime
    Synopsis: public void setTime(int parameterIndex, java.sql.Time x,
    java.util.Calendar cal)
    throws java.sql.SQLException;

    Parameters

    • parameterIndex - the first parameter is 1, the second is 2, ...
    • x - the parameter value

    Exceptions

    SQLException

    if a database-access error occurs.

    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.

    Method setTimestamp(int, Timestamp)

    setTimestamp Methods setTimestamp
    Synopsis: public void setTimestamp(int parameterIndex, java.sql.Timestamp x)
    throws java.sql.SQLException;

    Parameters

    • parameterIndex - the first parameter is 1, the second is 2, ...
    • x - the parameter value

    Exceptions

    SQLException

    if a database-access error occurs.

    Set a parameter to a java.sql.Timestamp value.

    Method setTimestamp(int, Timestamp, Calendar)

    setTimestamp Methods setTimestamp
    Synopsis: public void setTimestamp(int parameterIndex, java.sql.Timestamp x,
    java.util.Calendar cal)
    throws java.sql.SQLException;


    Parameters

    • parameterIndex - the first parameter is 1, the second is 2, ...
    • x - the parameter value

    Exceptions

    SQLException

    if a database-access error occurs.

    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.

    Method setTransactionIsolation(int)

    setTransactionIsolation Methods setTransactionIsolation
    Synopsis: public void setTransactionIsolation(int value)
    throws java.sql.SQLException;

    Parameters

    • level - the transaction isolation level

    Exceptions

    SQLException

    if a database-access error occurs.

    Set the transaction isolation.

    Method setType(int)

    setType Methods setType
    Synopsis: public void setType(int value) throws java.sql.SQLException;

    Parameters

    • value - may be TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, or TYPE_SCROLL_SENSITIVE

    Exceptions

    SQLException

    if a database-access error occurs

    Set the type of this result set.

    Method setTypeMap(Map)

    setTypeMap Methods setTypeMap
    Synopsis: public void setTypeMap(java.util.Map value)
    throws java.sql.SQLException;

    Parameters

    • map - a map object

    Exceptions

    SQLException

    if a database-access error occurs.

    Install a type-map object as the default type-map for this rowset.

    Method setUnicodeStream(int, InputStream, int)

    setUnicodeStream Methods setUnicodeStream
    Synopsis: public void setUnicodeStream(int parameterIndex,
    java.io.InputStream x, int length)
    throws java.sql.SQLException;

    Parameters

    • parameterIndex - the first parameter is 1, the second is 2, ...
    • x - the java input stream which contains the UNICODE parameter value
    • length - the number of bytes in the stream

    Exceptions

    SQLException

    if a database-access error occurs.

    Deprecated

    When a very large UNICODE 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. The JDBC driver will do any necessary conversion from UNICODE to the database char format.

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

    Method setUrl(String)

    setUrl Methods setUrl
    Synopsis: public void setUrl(java.lang.String s) throws java.sql.SQLException;

    Parameters

    • url - a string value, may be null

    Exceptions

    SQLException

    if a database-access error occurs.

    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.

    Method setUsername(String)

    setUsername Methods setUsername
    Synopsis: public void setUsername(java.lang.String s)
    throws java.sql.SQLException;

    Parameters

    • name - a user name

    Exceptions

    SQLException

    if a database-access error occurs.

    Set the user name.


    Referenced by...