|
Generated by JDiff |
||||||||
| PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES | |||||||||
This file contains all the changes in documentation in the packagejava.sqlas colored differences. Deletions are shownlike this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.
Class Array, Object getArray()JDBC 2.0The mapping in the Java programming language for the SQL type
ARRAY. By default anArrayobject is a transaction-duration reference to an SQLarrayARRAYvalue. By default anArrayobject is implemented using an SQL LOCATOR(array) internally which means that anArrayobject contains a logical pointer to the data in the SQLARRAYvalue on the server rather than containing theARRAYvalue's data.The
Arrayinterface provides methods for bringing an SQLARRAYvalue's data to the client as either an array or aResultSetobject.If the elements of the SQL
ARRAYare a UDT they may be custom mapped. To create a custom mapping a programmer must do two things:
- create a class that implements the SQLData interface for the UDT to be custom mapped. This will typically be done using a tool.
- make an entry in a type map that contains
- the fully-qualified SQL type name of the UDT
- the
Classobject for the class implementingSQLDataWhen a type map with an entry for the base type is supplied to the methods
getArrayandgetResultSetthe mapping it contains will be used to map the elements of theARRAYvalue. If no type map is supplied which would typically be the case the connection's type map is used by default. If the connection's type map or a type map supplied to a method has no entry for the base type the elements are mapped according to the standard mapping.NOTE: This interface is new in the JDBC 2.0 API
.
Retrieves the contents of the SQLClass Array, Object getArray(Map)arrayARRAYvalue designated by thisArrayobject in the form of an array in the Java programming language. This version of the methodgetArrayuses the type map associated with the connection for customizations of the type mappings. @return an array in the Java programming language that contains the ordered elements of the SQLARRAYobjectvalue designated by this object @exception SQLException if an error occurs while attempting to access the array @since 1.2 @see What Is in the JDBC 2.0 API
Retrieves the contents of the SQL array designated by thisClass Array, Object getArray(long, int)Arrayobject. Thisusingmethod uses the specifiedmapfor type map customizations.Ifunless the base type of the array does not match a user-defined type inmapin which case it uses the standard mapping. This version of the methodgetArrayuses either the given type map or the standard mapping; it never usesisthe type map associatedusedwith theinsteadconnection. @param map ajava.util.Mapobject that contains mappings of SQL type names to classes in the Java programming language @return an array in the Java programming language that contains the ordered elements of the SQL array designated by this object @exception SQLException if an error occurs while attempting to access the array @since 1.2 @see What Is in the JDBC 2.0 API
Returns an array containing a slice of the SQLClass Array, Object getArray(long, int, Map)arrayARRAYvalue designated by thisArrayobject beginning with the specifiedindexand containing up tocountsuccessive elements of the SQL array. This method uses the type-map associated with the connection for customizations of the type-mappings. @param index the array index of the first element to retrieve; the first element is at index 1 @param count the number of successive SQL array elements to retrieve @return an array containing up tocountconsecutive elements of the SQL array beginning with elementindex@exception SQLException if an error occurs while attempting to access the array @since 1.2 @see What Is in the JDBC 2.0 API
Returns an array containing a slice of the SQL array object designated by thisClass Array, int getBaseType()Arrayobject beginning with the specifiedindexand containing up tocountsuccessive elements of the SQL array.This method uses the specified
mapfor type-map customizations unless the base type of the array does not match a user-defined type inmapin which case it uses the standard mapping. This version of the methodgetArrayuses either the given type map or the standard mapping; it never uses the type map associated with the connection. @param index the array index of the first element to retrieve; the first element is at index 1 @param count the number of successive SQL array elements to retrieve @param map ajava.util.Mapobject that contains SQL type names and the classes in the Java programming language to which they are mapped @return an array containing up tocountconsecutive elements of the SQL array designated by thisArrayobject beginning with elementindex. @exception SQLException if an error occurs while attempting to access the array @since 1.2 @see What Is in the JDBC 2.0 API
Returns the JDBC type of the elements in the array designated by thisClass Array, String getBaseTypeName()Arrayobject. @return a constant from the class java.sql.Types that is the type code for the elements in the array designated by thisArrayobject. @exception SQLException if an error occurs while attempting to access the base type @since 1.2 @see What Is in the JDBC 2.0 API
Returns the SQL type name of the elements in the array designated by thisClass Array, ResultSet getResultSet()Arrayobject. If the elements are a built-in type it returns the database-specific type name of the elements. If the elements are a user-defined type (UDT) this method returns the fully-qualified SQL type name. @return aStringthat is the database-specific name for a built-in base type or the fully-qualified SQL type name for a base type that is a UDT @exception SQLException if an error occurs while attempting to access the type name @since 1.2 @see What Is in the JDBC 2.0 API
Returns a result set that contains the elements of theClass Array, ResultSet getResultSet(Map)arraySQLARRAYvalue designated by thisArrayobject. If appropriate the elements of the array are mapped using the connection's type map; otherwise the standard mapping is used.The result set contains one row for each array element with two columns in each row. The second column stores the element value; the first column stores the index into the array for that element (with the first array element being at index 1). The rows are in ascending order corresponding to the order of the indices. @return a ResultSet object containing one row for each of the elements in the array designated by this
Arrayobject with the rows in ascending order based on the indices. @exception SQLException if an error occurs while attempting to access the array @since 1.2 @see What Is in the JDBC 2.0 API
Returns a result set that contains the elements of theClass Array, ResultSet getResultSet(long, int)arraySQLARRAYvalue designated by thisArrayobject. Thisandmethod uses thegivenspecifiedmapto mapforthe arraytype mapelements.customizationsIfunless the base type of the array does not match a user-defined type inmapin which case it uses the standard mapping. This version of the methodgetResultSetuses either the given type map or the standard mapping; itisnever uses the type map associated withused insteadthe connection.The result set contains one row for each array element with two columns in each row. The second column stores the element value; the first column stores the index into the array for that element (with the first array element being at index 1). The rows are in ascending order corresponding to the order of the indices. @param map contains the mapping of SQL user-defined types to classes in the Java
(tm)programming language @return aResultSetobject containing one row for each of the elements in the array designated by thisArrayobject with the rows in ascending order based on the indices. @exception SQLException if an error occurs while attempting to access the array @since 1.2 @see What Is in the JDBC 2.0 API
Returns a result set holding the elements of the subarray that starts at indexClass Array, ResultSet getResultSet(long, int, Map)indexand contains up tocountsuccessive elements. This method uses the connection's type map to map the elements of the array if the map contains an entry for the base type. Otherwise the standard mapping is used.The result set has one row for each element of the SQL array designated by this object with the first row containing the element at index
index. The result set has up tocountrows in ascending order based on the indices. Each row has two columns: The second column stores the element value; the first columnstroesstores the index into the array for that element. @param index the array index of the first element to retrieve; the first element is at index 1 @param count the number of successive SQL array elements to retrieve @return aResultSetobject containing up tocountconsecutive elements of the SQL array designated by thisArrayobject starting at indexindex. @exception SQLException if an error occurs while attempting to access the array @since 1.2 @see What Is in the JDBC 2.0 API
Returns a result set holding the elements of the subarray that starts at indexindexand contains up tocountsuccessive elements. This method uses theMapspecifiedobjectmapto map the elementsforof the arraytype map customizations unless the base type of the array does not match a user-defined type inmapin which case it uses the standard mapping. This version of the methodgetResultSetuses either the given type map or the standard mapping; it never uses the type map associated with the connection.The result set has one row for each element of the SQL array designated by this object with the first row containing the element at index
index. The result set has up tocountrows in ascending order based on the indices. Each row has two columns: The second column stores the element value; the first column stroes the index into the array for that element. @param index the array index of the first element to retrieve; the first element is at index 1 @param count the number of successive SQL array elements to retrieve @param map theMapobject that contains the mapping of SQL type names to classes in the Java(tm) programming language @return aResultSetobject containing up tocountconsecutive elements of the SQL array designated by thisArrayobject starting at indexindex. @exception SQLException if an error occurs while attempting to access the array @since 1.2 @see What Is in the JDBC 2.0 API
Class BatchUpdateException, constructor BatchUpdateException()JDBC 2.0An exception thrown when an error occurs during a batch update operation. In addition to the information provided by SQLException aBatchUpdateExceptionprovides the update counts for all commands that were executed successfully during the batch update that is all commands that were executed before the error occurred. The order of elements in an array of update counts corresponds to the order in which commands were added to the batch.After a command in a batch update fails to execute properly and a
BatchUpdateExceptionis thrown the driver may or may not continue to process the remaining commands in the batch. If the driver continues processing after a failure the array returned by the methodBatchUpdateException.getUpdateCountswill have an element for every command in the batch rather than only elements for the commands that executed successfully before the error. In the case where the driver continues processing commands the array element for any command that failed is-3.This class is new in the JDBC 2.0 API.
Constructs aClass BatchUpdateException, constructor BatchUpdateException(String, String, int, int[])BatchUpdateExceptionobject with the reason SQLState and update count initialized tonulland the vendor code initialized to 0. @since 1.2 @see What Is in the JDBC 2.0 API
Constructs a fullyClass BatchUpdateException, constructor BatchUpdateException(String, String, int[])-specifiedBatchUpdateExceptionobject initializing it with the given values. @param reason a description of the error @param SQLState an X/OPEN code identifying the error @param vendorCode an exception codeforused by a particular database vendor @param updateCounts an array ofintwith each element indicating the update count for a SQL command that executed successfully before the exception was thrown @since 1.2 @see What Is in the JDBC 2.0 API
Constructs aClass BatchUpdateException, constructor BatchUpdateException(String, int[])BatchUpdateExceptioninitialized with the given arguments (reasonSQLStateandupdateCounts) and 0 for the vendor code. @param reason a description of the exception @param SQLState an X/OPEN code identifying the exception @param updateCounts an array ofintwith each element indicating the update count for a SQL command that executed successfully before the exception was thrown @since 1.2 @see What Is in the JDBC 2.0 API
Constructs aClass BatchUpdateException, constructor BatchUpdateException(int[])BatchUpdateExceptioninitialized withreasonupdateCountsandnullfor the SQLState and 0 for the vendorCode. @param reason a description of the exception @param updateCounts an array ofintwith each element indicating the update count for a SQL command that executed successfully before the exception was thrown @since 1.2 @see What Is in the JDBC 2.0 API
Constructs aClass BatchUpdateException, int[] getUpdateCounts()BatchUpdateExceptioninitialized tonullfor the reason and SQLState and 0 for the vendor code. @param updateCounts an array ofintwith each element indicating the update count for a SQL command that executed successfully before the exception was thrown @since 1.2 @see What Is in the JDBC 2.0 API
Retrieves the update count for each update statement in the batch update that executed successfully before this exception occurred. A driver that implements batch updates may or may not continue to process the remaining commands in a batch when one of the commands fails to execute properly. If the driver continues processing commands the array returned by this method will have as many elements as there are commands in the batch; otherwise it will contain an update count for each command that executed successfully before theBatchUpdateExceptionwas thrown.The possible return values for this method were modified for the Java 2 SDK Standard Edition version 1.3. This was done to accommodate the new option of continuing to process commands in a batch update after a
@return an array ofBatchUpdateExceptionobject has been thrown.intcontaining the update counts for the updates that were executed successfully before this error occurred. Or if the driver continues to process commands after an error one of the following for every command in the batch:@since 1.3 @see What Is in the JDBC 2.0 API
- an update count
-2to indicate that the command executed successfully but the number of rows affected is unknown-3to indicate that the command failed to execute successfully
Class Blob, InputStream getBinaryStream()JDBC 2.0The representation (mapping) in the JavaTM programming language of an SQLBLOBvalue. An SQLBLOBis a built-in type that stores a Binary Large Object as a column value in a row of a database table. The driver implementsBlobusing an SQLlocator(BLOB)which means that aBlobobject contains a logical pointer to the SQLBLOBdata rather than the data itself. ABlobobject is valid for the duration of the transaction in which is was created.Methods in the interfaces ResultSet CallableStatement and PreparedStatement such as
getBlobandsetBloballow a programmer to accessthean SQLBLOBvalue. TheBlobinterface provides methods for getting the length of an SQLBLOB(Binary Large Object) value for materializing aBLOBvalue on the client and for determining the position of a pattern of bytes within aBLOBvalue.This class is new in the JDBC 2.0 API. @since 1.2
Retrieves theClass Blob, byte[] getBytes(long, int)BLOBdesignated by thisBlobinstance as a stream. @return a stream containing theBLOBdata @exception SQLException if there is an error accessing theBLOB@since 1.2 @see What Is in the JDBC 2.0 API
Returns as an array of bytes part or all of theClass Blob, long length()BLOBvalue that thisBlobobject designates. The byte array contains up tolengthconsecutive bytes starting at positionpos. @param pos the ordinal position of the first byte in theBLOBvalue to be extracted; the first byte is at position 1 @param lengthisthe number of consecutive bytes to be copied @return a byte array containing up tolengthconsecutive bytes from theBLOBvalue designated by thisBlobobject starting with the byte at positionpos.@exception SQLException if there is an error accessing theBLOB@since 1.2 @see What Is in the JDBC 2.0 API
Returns the number of bytes in theClass Blob, long position(Blob, long)BLOBvalue designated by thisBlobobject. @return length of theBLOBin bytes @exception SQLException if there is an error accessing the length of theBLOB@since 1.2 @see What Is in the JDBC 2.0 API
Determines the byte position in theClass Blob, long position(byte[], long)BLOBvalue designated by thisBlobobject at whichpatternbegins. The search begins at positionstart. @param pattern theBlobobject designating theBLOBvalue for which to search @param start the position in theBLOBvalue at which to begin searching; the first position is 1 @return the position at which the pattern begins else -1 @exception SQLException if there is an error accessing theBLOB@since 1.2 @see What Is in the JDBC 2.0 API
Determines the byte position at which the specified bytepatternbegins within theBLOBvalue that thisBlobobject represents. The search forpatternbegins at positionstart. @param pattern the byte array for which to search @param start the position at which to begin searching; the first position is 1 @return the position at which the pattern appears else -1.@exception SQLException if there is an error accessing theBLOB@since 1.2 @see What Is in the JDBC 2.0 API
The interface used to execute SQL stored procedures. JDBC provides a stored procedure SQL escape syntax that allows stored procedures to be called in a standard way for all RDBMSs. This escape syntax has one form that includes a result parameter and one that does not. If used the result parameter must be registered as an OUT parameter. The other parameters can be used for input output or both. Parameters are referred to sequentially by numberClass CallableStatement, Array getArray(int).Thewith the first parameterisbeing 1.
{ = call <procedure-name>[<arg1> <arg2> ...]} {call <procedure-name>[<arg1> <arg2> ...]}IN parameter values are set using the set methods inherited from PreparedStatement The type of all OUT parameters must be registered prior to executing the stored procedure; their values are retrieved after execution via the
getmethods provided here.A
CallableStatementcan return one ResultSet or multipleResultSetobjetsobjects. MultipleResultSetobjects are handled using operations inherited from StatementFor maximum portability a call's
ResultSetobjects and update counts should be processed prior to getting the values of output parameters.Methods that are new in the JDBC 2.0 API are marked "Since 1.2." @see Connection#prepareCall @see ResultSet
Class CallableStatement, BigDecimal getBigDecimal(int)JDBC 2.0Gets the value of a JDBCARRAYparameter as an Array object in the Java programming language. @param i the first parameter is 1 the second is 2 and so on @return the parameter value as anArrayobject in the Java programming language. If the value was SQLNULLthe valuenullis returned. @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class CallableStatement, BigDecimal getBigDecimal(int, int)JDBC 2.0Gets the value of a JDBCNUMERICparameter as ajava.math.BigDecimalobject with as many digits to the right of the decimal point as the value contains. @param parameterIndex the first parameter is 1 the second is 2 and so on @return the parameter value in full precision. If the value is SQLNULLthe result isnull. @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Gets the value of a JDBCClass CallableStatement, Blob getBlob(int)NUMERICparameter as ajava.math.BigDecimalobject with scale digits to the right of the decimal point. @param parameterIndex the first parameter is 1 the second is 2 and so on @param scale the number of digits to the right of the decimal point @return the parameter value. If the value is SQLNULLthe result isnull. @exception SQLException if a database access error occurs @deprecated
Class CallableStatement, boolean getBoolean(int)JDBC 2.0Gets the value of a JDBCBLOBparameter as a Blob object in the Java programming language. @param i the first parameter is 1 the second is 2 and so on @return the parameter value as aBlobobject in the Java programming language. If the value was SQLNULLthe valuenullis returned. @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Gets the value of a JDBCClass CallableStatement, byte getByte(int)BITparameter as abooleanin the Java programming language. @param parameterIndex the first parameter is 1 the second is 2 and so on @return the parameter value. If the value is SQLNULLthe result isfalse. @exception SQLException if a database access error occurs
Gets the value of a JDBCClass CallableStatement, byte[] getBytes(int)TINYINTparameter as abytein the Java programming language. @param parameterIndex the first parameter is 1 the second is 2 and so on @return the parameter value. If the value is SQLNULLthe result is 0. @exception SQLException if a database access error occurs
Gets the value of a JDBCClass CallableStatement, Clob getClob(int)BINARYorVARBINARYparameter as an array ofbytevlauresvalues in the Java programming language. @param parameterIndex the first parameter is 1 the second is 2 and so on @return the parameter value. If the value is SQLNULLthe result isnull. @exception SQLException if a database access error occurs
Class CallableStatement, Date getDate(int)JDBC 2.0Gets the value of a JDBCCLOBparameter as aClobobject in the Java programming language. @param i the first parameter is 1 the second is 2 and so on @return the parameter value as aClobobject in the Java programming language. If the value was SQLNULLthe valuenullis returned. @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Gets the value of a JDBCClass CallableStatement, Date getDate(int, Calendar)DATEparameter as ajava.sql.Dateobject. @param parameterIndex the first parameter is 1 the second is 2 and so on @return the parameter value. If the value is SQLNULLthe result isnull. @exception SQLException if a database access error occurs
Gets the value of a JDBCClass CallableStatement, double getDouble(int)DATEparameter as ajava.sql.Dateobject using the givenCalendarobject to construct the date. With aCalendarobject the driver can calculate the date taking into account a custom timezone and locale. If noCalendarobject is specified the driver uses the default timezone and locale. @param parameterIndex the first parameter is 1 the second is 2 and so on @param cal theCalendarobject the driver will use to construct the date @return the parameter value. If the value is SQLNULLthe result isnull. @exception SQLException if a database access error occurs
Gets the value of a JDBCClass CallableStatement, float getFloat(int)DOUBLEparameter as adoublein the Java programming language. @param parameterIndex the first parameter is 1 the second is 2 and so on @return the parameter value. If the value is SQLNULLthe result is 0. @exception SQLException if a database access error occurs
Gets the value of a JDBCClass CallableStatement, int getInt(int)FLOATparameter as afloatin the Java programming language. @param parameterIndex the first parameter is 1 the second is 2 and so on @return the parameter value. If the value is SQLNULLthe result is 0. @exception SQLException if a database access error occurs
Gets the value of a JDBCClass CallableStatement, long getLong(int)INTEGERparameter as anintin the Java programming language. @param parameterIndex the first parameter is 1 the second is 2 and so on @return the parameter value. If the value is SQLNULLthe result is 0. @exception SQLException if a database access error occurs
Gets the value of a JDBCClass CallableStatement, Object getObject(int)BIGINTparameter as alongin the Java programming language. @param parameterIndex the first parameter is 1 the second is 2 and so on @return the parameter value. If the value is SQLNULLthe result is 0. @exception SQLException if a database access error occurs
Gets the value of a parameter as anClass CallableStatement, Object getObject(int, Map)objectObjectin the Java programming language.This method returns a Java object whose type corresponds to the JDBC type that was registered for this parameter using the method
registerOutParameter. By registering the target JDBC type asjava.sql.Types.OTHERthis method can be used to read database-specific abstract data types. @param parameterIndexThethe first parameter is 1 the second is 2 and so on @return Ajava.lang.Objectholding the OUT parameter value. @exception SQLException if a database access error occurs @see Types
Class CallableStatement, Ref getRef(int)JDBC 2.0Returns an object representing the value of OUT parameteriand usesmapfor the custom mapping of the parameter value.This method returns a Java object whose type corresponds to the JDBC type that was registered for this parameter using the method
registerOutParameter. By registering the target JDBC type asjava.sql.Types.OTHERthis method can be used to read database-specific abstract data types. @param i the first parameter is 1 the second is 2 and so on @param map the mapping from SQL type names to Java classes @return ajava.lang.Objectholding the OUT parameter value.@exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class CallableStatement, short getShort(int)JDBC 2.0Gets the value of a JDBCREF(<structured-type>)parameter as a Ref object in the Java programming language. @param i the first parameter is 1 the second is 2 and so on @return the parameter value as aRefobject in the Java programming language. If the value was SQLNULLthe valuenullis returned. @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Gets the value of a JDBCClass CallableStatement, String getString(int)SMALLINTparameter as ashortin the Java programming language. @param parameterIndex the first parameter is 1 the second is 2 and so on @return the parameter value. If the value is SQLNULLthe result is 0. @exception SQLException if a database access error occurs
Retrieves the value of a JDBCClass CallableStatement, Time getTime(int)CHARVARCHARorLONGVARCHARparameter as aStringin the Java programming language.For the fixed-length type JDBC
CHARtheStringobject returned has exactly the same value the JDBCCHARvalue had in the database including any padding added by the database. @param parameterIndex the first parameter is 1 the second is 2 and so on @return the parameter value. If the value is SQLNULLthe result isnull. @exception SQLException if a database access error occurs
Get the value of a JDBCClass CallableStatement, Time getTime(int, Calendar)TIMEparameter as ajava.sql.Timeobject. @param parameterIndex the first parameter is 1 the second is 2 and so on @return the parameter value. If the value is SQLNULLthe result isnull. @exception SQLException if a database access error occurs
Gets the value of a JDBCClass CallableStatement, Timestamp getTimestamp(int)TIMEparameter as ajava.sql.Timeobject using the givenCalendarobject to construct the time. With aCalendarobject the driver can calculate the time taking into account a custom timezone and locale. If noCalendarobject is specified the driver uses the default timezone and locale. @param parameterIndex the first parameter is 1 the second is 2 and so on @param cal theCalendarobject the driver will use to construct the time @return the parameter value; if the value is SQLNULLthe result isnull. @exception SQLException if a database access error occurs
Gets the value of a JDBCClass CallableStatement, Timestamp getTimestamp(int, Calendar)TIMESTAMPparameter as ajava.sql.Timestampobject. @param parameterIndex the first parameter is 1 the second is 2 and so on @return the parameter value. If the value is SQLNULLthe result isnull. @exception SQLException if a database access error occurs
Gets the value of a JDBCClass CallableStatement, void registerOutParameter(int, int)TIMESTAMPparameter as ajava.sql.Timestampobject using the givenCalendarobject to construct theTimestampobject. With aCalendarobject the driver can calculate the timestamp taking into account a custom timezone and locale. If noCalendarobject is specified the driver uses the default timezone and locale. @param parameterIndex the first parameter is 1 the second is 2 and so on @param cal theCalendarobject the driver will use to construct the timestamp @return the parameter value. If the value is SQLNULLthe result isnull. @exception SQLException if a database access error occurs
Registers the OUT parameter in ordinal positionClass CallableStatement, void registerOutParameter(int, int, String)parameterIndexto the JDBC typesqlType. All OUT parameters must be registered before a stored procedure is executed.The JDBC type specified by
sqlTypefor an OUT parameter determines the Java type that must be used in thegetmethod to read the value of that parameter.If the JDBC type expected to be returned to this output parameter is specific to this particular database
sqlTypeshould bejava.sql.Types.OTHER. The method #getObject retrieves the value. @param parameterIndex the first parameter is 1 the second is 2 and so on @param sqlType the JDBC type code defined byjava.sql.Types. If the parameter is of JDBC typeNumericNUMERICorDecimalDECIMALthe version ofregisterOutParameterthat accepts a scale value should be used. @exception SQLException if a database access error occurs @see Types
Class CallableStatement, boolean wasNull()JDBC 2.0Registers the designated output parameter. This version of the methodregisterOutParametershould be used for a user-named or REF output parameter. Examples of user-named types include: STRUCT DISTINCT JAVA_OBJECT and named array types. Before executing a stored procedure call you must explicitly callregisterOutParameterto register the type fromjava.sql.Typesfor each OUT parameter. For a user-named parameter the fully-qualified SQL type name of the parameter should also be given while a REF parameter requires that the fully-qualified type name of the referenced type be given. A JDBC driver that does not need the type code and type name information may ignore it. To be portable however applications should always provide these values for user-named and REF parameters. Although it is intended for user-named and REF parameters this method may be used to register a parameter of any JDBC type. If the parameter does not have a user-named or REF type the typeName parameter is ignored.Note: When reading the value of an out parameter you must use the
getXXXmethod whose Java type XXX corresponds to the parameter's registered SQL type. @param parameterIndex the first parameter is 1 the second is 2 ... @param sqlType a value from java.sql.Types @param typeName the fully-qualified name of an SQL structured type @exception SQLException if a database-access error occurs @see Types @since 1.2 @see What Is in the JDBC 2.0 API
Indicates whether or not the last OUT parameter read had the value of SQLNULL. Note that this method should be called only after callingtheamethod; otherwise there is no value to use in determining whether it isgetgetXXXnullor not. @returntrueif the last parameter read was SQLNULL;falseotherwise.@exception SQLException if a database access error occurs
Class Clob, InputStream getAsciiStream()JDBC 2.0The mapping in the JavaTM programming language for the SQLCLOBtype. An SQLCLOBis a built-in type that stores a Character Large Object as a column value in a row of a database table. The driver implements aClobobject using an SQLlocator(CLOB)which means that aClobobject contains a logical pointer to the SQLCLOBdata rather than the data itself. AClobobject is valid for the duration of the transaction in which it was created.The
Clobinterface provides methods for getting the length of an SQLCLOB(Character Large Object) value for materializing aCLOBvalue on the client and for searching for a substring orCLOBobject within aCLOBvalue. Methods in the interfaces ResultSet CallableStatement and PreparedStatement such asgetClobandsetCloballow a programmer to accessthean SQLCLOBvalue.This class is new in the JDBC 2.0 API
.
Gets theClass Clob, Reader getCharacterStream()CLOBvalue designated by thisClobobject as a stream of Ascii bytes. @return an ascii stream containing theCLOBdata @exception SQLException if there is an error accessing theCLOBvalue @since 1.2 @see What Is in the JDBC 2.0 API
Gets theClass Clob, String getSubString(long, int)CLOBvalue designated by thisClobcontentsobject as a Unicode stream. @return a Unicode stream containing theCLOBdata @exception SQLException if there is an error accessing theCLOBvalue @since 1.2 @see What Is in the JDBC 2.0 API
Returns a copy of the specified substring in theClass Clob, long length()CLOBvalue designated by thisClobobject. The substring begins at positionposand has up tolengthconsecutive characters. @param pos the first character of the substring to be extracted. The first character is at position 1. @param length the number of consecutive characters to be copied @return aStringthat is the specified substring in theCLOBvalue designated by thisClobobject @exception SQLException if there is an error accessing theCLOB@since 1.2 @see What Is in the JDBC 2.0 API
Returns the number of characters in theClass Clob, long position(Clob, long)CLOBvalue designated by thisClobobject. @return length of theCLOBin characters @exception SQLException if there is an error accessing the length of theCLOB@since 1.2 @see What Is in the JDBC 2.0 API
Determines the character position at which the specifiedClass Clob, long position(String, long)Clobobjectsearchstrappears in thisClobobject. The search begins at positionstart. @param searchstr theClobobject for which to search @param start the position at which to begin searching; the first position is 1 @return the position at which theClobobject appears else -1; the first position is 1 @exception SQLException if there is an error accessing theCLOBvalue @since 1.2 @see What Is in the JDBC 2.0 API
Determines the character position at which the specified substringsearchstrappears in the SQLCLOBvalue represented by thisClobobject. The search begins at positionstart. @param searchstr the substring for which to search @param start the position at which to begin searching; the first position is 1 @return the position at which the substring appears else -1; the first position is 1 @exception SQLException if there is an error accessing theCLOBvalue @since 1.2 @see What Is in the JDBC 2.0 API
Class Connection, Statement createStatement()A connection (session) with a specific database. Within the context of a Connection SQL statements are executed and results are returned.
A Connection's database is able to provide information describing its tables its supported SQL grammar its stored procedures the capabilities of this connection and so on. This information is obtained with the
getMetaDatamethod.Note: By default the Connection automatically commits changes after executing each statement. If auto commit has been disabled
an explicitthe methodcommitmust bedonecalledorexplicitly; otherwise database changes will not be saved. @see DriverManager#getConnection @see Statement @see ResultSet @see DatabaseMetaDataMethods that are new in the JDBC 2.0 API are tagged @since 1.2.
Creates aClass Connection, Statement createStatement(int, int)Statementobject for sending SQL statements to the database. SQL statements without parameters are normally executed using Statement objects. If the same SQL statement is executed many times it is more efficient to use aPreparedStatementJDBC2object.0Result sets created using the returnedStatementobject will by default have forward-only type and read-only concurrencyby default. @return a new Statement object @exception SQLException if a database access error occurs
Class Connection, Map getTypeMap()JDBC 2.0Creates aStatementobject that will generateResultSetobjects with the given type and concurrency. This method is the same as thecreateStatementmethod above but it allows the default result set type and result set concurrency type to be overridden. @param resultSetType a result set type; see ResultSet.TYPE_XXX @param resultSetConcurrency a concurrency type; see ResultSet.CONCUR_XXX @return a new Statement object @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class Connection, CallableStatement prepareCall(String)JDBC 2.0Gets the type map object associated with this connection. Unless the application has added an entry to the type map the map returned will be empty. @return thejava.util.Mapobject associated with thisConnectionobject @since 1.2 @see What Is in the JDBC 2.0 API
Creates aClass Connection, CallableStatement prepareCall(String, int, int)CallableStatementobject for calling database stored procedures. TheCallableStatementobject provides methods for setting up its IN and OUT parameters and methods for executing the call to a stored procedure.Note: This method is optimized for handling stored procedure call statements. Some drivers may send the call statement to the database when the method
prepareCallis done; others may wait until theCallableStatementobject is executed. This has no direct effect on users; however it does affect which method throws certain SQLExceptions.JDBC 2.0Result sets created using the returned CallableStatement will have forward-only type and read-only concurrency by default. @param sql a SQL statement that may contain one or more ' ' parameter placeholders. Typically this statement is a JDBC function call escape string. @return a new CallableStatement object containing the pre-compiled SQL statement @exception SQLException if a database access error occurs
Class Connection, PreparedStatement prepareStatement(String)JDBC 2.0Creates aCallableStatementobject that will generateResultSetobjects with the given type and concurrency. This method is the same as theprepareCallmethod above but it allows the default result set type and result set concurrency type to be overridden. @param resultSetType a result set type; see ResultSet.TYPE_XXX @param resultSetConcurrency a concurrency type; see ResultSet.CONCUR_XXX @return a new CallableStatement object containing the pre-compiled SQL statement @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Creates aClass Connection, PreparedStatement prepareStatement(String, int, int)PreparedStatementobject for sending parameterized SQL statements to the database. A SQL statement with or without IN parameters can be pre-compiled and stored in a PreparedStatement object. This object can then be used to efficiently execute this statement multiple times.Note: This method is optimized for handling parametric SQL statements that benefit from precompilation. If the driver supports precompilation the method
prepareStatementwill send the statement to the database for precompilation. Some drivers may not support precompilation. In this case the statement may not be sent to the database until thePreparedStatementis executed. This has no direct effect on users; however it does affect which method throws certain SQLExceptions.JDBC 2.0Result sets created using the returned PreparedStatement will have forward-only type and read-only concurrency by default. @param sql a SQL statement that may contain one or more ' ' IN parameter placeholders @return a new PreparedStatement object containing the pre-compiled statement @exception SQLException if a database access error occurs
Class Connection, void setTypeMap(Map)JDBC 2.0Creates aPreparedStatementobject that will generateResultSetobjects with the given type and concurrency. This method is the same as theprepareStatementmethod above but it allows the default result set type and result set concurrency type to be overridden. @param resultSetType a result set type; see ResultSet.TYPE_XXX @param resultSetConcurrency a concurrency type; see ResultSet.CONCUR_XXX @return a new PreparedStatement object containing the pre-compiled SQL statement @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
JDBC 2.0Installs the given type map as the type map for this connection. The type map will be used for the custom mapping of SQL structured types and distinct types. @param thejava.util.Mapobject to install as the replacement for thisConnectionobject's default type map @since 1.2 @see What Is in the JDBC 2.0 API
Comprehensive information about the database as a whole.Class DatabaseMetaData, boolean deletesAreDetected(int)Many of the methods here return lists of information in the form of
ResultSetobjects. You can use the normalResultSetmethods such as getString and getInt to retrieve the data from theseResultSetsResultSet. If a given form of metadata is not available these methods should throw an SQLException.Some of these methods take arguments that are String patterns. These arguments all have names such as fooPattern. Within a pattern String "%" means match any substring of 0 or more characters and "_" means match any one character. Only metadata entries matching the search pattern are returned. If a search pattern argument is set to a null ref that argument's criteria will be dropped from the search.
An
SQLExceptionwill be thrown if a driver does not support a meta data method. In the case of methods that return aResultSeteither aResultSet(which may be empty) is returned or a SQLException is thrown.
Class DatabaseMetaData, ResultSet getBestRowIdentifier(String, String, String, int, boolean)JDBC 2.0Indicates whether or not a visible row delete can be detected by calling ResultSet.rowDeleted(). If deletesAreDetected() returns false then deleted rows are removed from the result set. @param result set type i.e. ResultSet.TYPE_XXX @return true if changes are detected by the resultset type @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Gets a description of a table's optimal set of columns that uniquely identifies a row. They are ordered by SCOPE.Class DatabaseMetaData, ResultSet getCatalogs()Each column description has the following columns:
@param catalog a catalog name; "" retrieves those without a catalog; null means drop catalog name from the selection criteria @param schema a schema name; "" retrieves those without a schema @param table a table name @param scope the scope of interest; use same values as SCOPE @param nullable include columns that are nullable @return
- SCOPE short => actual scope of result
- bestRowTemporary - very temporary while using row
- bestRowTransaction - valid for remainder of current transaction
- bestRowSession - valid for remainder of current session
- COLUMN_NAME String => column name
- DATA_TYPE short => SQL data type from java.sql.Types
- TYPE_NAME String => Data source dependent type name for a UDT the type name is fully qualified
- COLUMN_SIZE int => precision
- BUFFER_LENGTH int => not used
- DECIMAL_DIGITS short => scale
- PSEUDO_COLUMN short => is this a pseudo column like an Oracle ROWID
- bestRowUnknown - may or may not be pseudo column
- bestRowNotPseudo - is NOT a pseudo column
- bestRowPseudo - is a pseudo column
ResultSet- each row is a column description @exception SQLException if a database access error occurs
Gets the catalog names available in this database. The results are ordered by catalog name.Class DatabaseMetaData, ResultSet getColumnPrivileges(String, String, String, String)The catalog column is:
@return
- TABLE_CAT String => catalog name
ResultSet- each row has a single String column that is a catalog name @exception SQLException if a database access error occurs
Gets a description of the access rights for a table's columns.Class DatabaseMetaData, ResultSet getColumns(String, String, String, String)Only privileges matching the column name criteria are returned. They are ordered by COLUMN_NAME and PRIVILEGE.
Each privilige description has the following columns:
@param catalog a catalog name; "" retrieves those without a catalog; null means drop catalog name from the selection criteria @param schema a schema name; "" retrieves those without a schema @param table a table name @param columnNamePattern a column name pattern @return
- TABLE_CAT String => table catalog (may be null)
- TABLE_SCHEM String => table schema (may be null)
- TABLE_NAME String => table name
- COLUMN_NAME String => column name
- GRANTOR => grantor of access (may be null)
- GRANTEE String => grantee of access
- PRIVILEGE String => name of access (SELECT INSERT UPDATE REFRENCES ...)
- IS_GRANTABLE String => "YES" if grantee is permitted to grant to others; "NO" if not; null if unknown
ResultSet- each row is a column privilege description @exception SQLException if a database access error occurs @see #getSearchStringEscape
Gets a description of table columns available in the specified catalog.Class DatabaseMetaData, Connection getConnection()Only column descriptions matching the catalog schema table and column name criteria are returned. They are ordered by TABLE_SCHEM TABLE_NAME and ORDINAL_POSITION.
Each column description has the following columns:
@param catalog a catalog name; "" retrieves those without a catalog; null means drop catalog name from the selection criteria @param schemaPattern a schema name pattern; "" retrieves those without a schema @param tableNamePattern a table name pattern @param columnNamePattern a column name pattern @return
- TABLE_CAT String => table catalog (may be null)
- TABLE_SCHEM String => table schema (may be null)
- TABLE_NAME String => table name
- COLUMN_NAME String => column name
- DATA_TYPE short => SQL type from java.sql.Types
- TYPE_NAME String => Data source dependent type name for a UDT the type name is fully qualified
- COLUMN_SIZE int => column size. For char or date types this is the maximum number of characters for numeric or decimal types this is precision.
- BUFFER_LENGTH is not used.
- DECIMAL_DIGITS int => the number of fractional digits
- NUM_PREC_RADIX int => Radix (typically either 10 or 2)
- NULLABLE int => is NULL allowed
- columnNoNulls - might not allow NULL values
- columnNullable - definitely allows NULL values
- columnNullableUnknown - nullability unknown
- REMARKS String => comment describing column (may be null)
- COLUMN_DEF String => default value (may be null)
- SQL_DATA_TYPE int => unused
- SQL_DATETIME_SUB int => unused
- CHAR_OCTET_LENGTH int => for char types the maximum number of bytes in the column
- ORDINAL_POSITION int => index of column in table (starting at 1)
- IS_NULLABLE String => "NO" means column definitely does not allow NULL values; "YES" means the column might allow NULL values. An empty string means nobody knows.
ResultSet- each row is a column description @exception SQLException if a database access error occurs @see #getSearchStringEscape
Class DatabaseMetaData, ResultSet getCrossReference(String, String, String, String, String, String)JDBC 2.0Retrieves the connection that produced this metadata object. @return the connection that produced this metadata object @since 1.2 @see What Is in the JDBC 2.0 API
Gets a description of the foreign key columns in the foreign key table that reference the primary key columns of the primary key table (describe how one table imports another's key.) This should normally return a single foreign key/primary key pair (most tables only import a foreign key from a table once.) They are ordered by FKTABLE_CAT FKTABLE_SCHEM FKTABLE_NAME and KEY_SEQ.Class DatabaseMetaData, ResultSet getExportedKeys(String, String, String)Each foreign key column description has the following columns:
@param primaryCatalog a catalog name; "" retrieves those without a catalog; null means drop catalog name from the selection criteria @param primarySchema a schema name; "" retrieves those without a schema @param primaryTable the table name that exports the key @param foreignCatalog a catalog name; "" retrieves those without a catalog; null means drop catalog name from the selection criteria @param foreignSchema a schema name; "" retrieves those without a schema @param foreignTable the table name that imports the key @return
- PKTABLE_CAT String => primary key table catalog (may be null)
- PKTABLE_SCHEM String => primary key table schema (may be null)
- PKTABLE_NAME String => primary key table name
- PKCOLUMN_NAME String => primary key column name
- FKTABLE_CAT String => foreign key table catalog (may be null) being exported (may be null)
- FKTABLE_SCHEM String => foreign key table schema (may be null) being exported (may be null)
- FKTABLE_NAME String => foreign key table name being exported
- FKCOLUMN_NAME String => foreign key column name being exported
- KEY_SEQ short => sequence number within foreign key
- UPDATE_RULE short => What happens to foreign key when primary is updated:
- importedNoAction - do not allow update of primary key if it has been imported
- importedKeyCascade - change imported key to agree with primary key update
- importedKeySetNull - change imported key to NULL if its primary key has been updated
- importedKeySetDefault - change imported key to default values if its primary key has been updated
- importedKeyRestrict - same as importedKeyNoAction (for ODBC 2.x compatibility)
- DELETE_RULE short => What happens to the foreign key when primary is deleted.
- importedKeyNoAction - do not allow delete of primary key if it has been imported
- importedKeyCascade - delete rows that import a deleted key
- importedKeySetNull - change imported key to NULL if its primary key has been deleted
- importedKeyRestrict - same as importedKeyNoAction (for ODBC 2.x compatibility)
- importedKeySetDefault - change imported key to default if its primary key has been deleted
- FK_NAME String => foreign key name (may be null)
- PK_NAME String => primary key name (may be null)
- DEFERRABILITY short => can the evaluation of foreign key constraints be deferred until commit
- importedKeyInitiallyDeferred - see SQL92 for definition
- importedKeyInitiallyImmediate - see SQL92 for definition
- importedKeyNotDeferrable - see SQL92 for definition
ResultSet- each row is a foreign key column description @exception SQLException if a database access error occurs @see #getImportedKeys
Gets a description of the foreign key columns that reference a table's primary key columns (the foreign keys exported by a table). They are ordered by FKTABLE_CAT FKTABLE_SCHEM FKTABLE_NAME and KEY_SEQ.Class DatabaseMetaData, ResultSet getImportedKeys(String, String, String)Each foreign key column description has the following columns:
@param catalog a catalog name; "" retrieves those without a catalog; null means drop catalog name from the selection criteria @param schema a schema name; "" retrieves those without a schema @param table a table name @return
- PKTABLE_CAT String => primary key table catalog (may be null)
- PKTABLE_SCHEM String => primary key table schema (may be null)
- PKTABLE_NAME String => primary key table name
- PKCOLUMN_NAME String => primary key column name
- FKTABLE_CAT String => foreign key table catalog (may be null) being exported (may be null)
- FKTABLE_SCHEM String => foreign key table schema (may be null) being exported (may be null)
- FKTABLE_NAME String => foreign key table name being exported
- FKCOLUMN_NAME String => foreign key column name being exported
- KEY_SEQ short => sequence number within foreign key
- UPDATE_RULE short => What happens to foreign key when primary is updated:
- importedNoAction - do not allow update of primary key if it has been imported
- importedKeyCascade - change imported key to agree with primary key update
- importedKeySetNull - change imported key to NULL if its primary key has been updated
- importedKeySetDefault - change imported key to default values if its primary key has been updated
- importedKeyRestrict - same as importedKeyNoAction (for ODBC 2.x compatibility)
- DELETE_RULE short => What happens to the foreign key when primary is deleted.
- importedKeyNoAction - do not allow delete of primary key if it has been imported
- importedKeyCascade - delete rows that import a deleted key
- importedKeySetNull - change imported key to NULL if its primary key has been deleted
- importedKeyRestrict - same as importedKeyNoAction (for ODBC 2.x compatibility)
- importedKeySetDefault - change imported key to default if its primary key has been deleted
- FK_NAME String => foreign key name (may be null)
- PK_NAME String => primary key name (may be null)
- DEFERRABILITY short => can the evaluation of foreign key constraints be deferred until commit
- importedKeyInitiallyDeferred - see SQL92 for definition
- importedKeyInitiallyImmediate - see SQL92 for definition
- importedKeyNotDeferrable - see SQL92 for definition
ResultSet- each row is a foreign key column description @exception SQLException if a database access error occurs @see #getImportedKeys
Gets a description of the primary key columns that are referenced by a table's foreign key columns (the primary keys imported by a table). They are ordered by PKTABLE_CAT PKTABLE_SCHEM PKTABLE_NAME and KEY_SEQ.Class DatabaseMetaData, ResultSet getIndexInfo(String, String, String, boolean, boolean)Each primary key column description has the following columns:
@param catalog a catalog name; "" retrieves those without a catalog; null means drop catalog name from the selection criteria @param schema a schema name; "" retrieves those without a schema @param table a table name @return
- PKTABLE_CAT String => primary key table catalog being imported (may be null)
- PKTABLE_SCHEM String => primary key table schema being imported (may be null)
- PKTABLE_NAME String => primary key table name being imported
- PKCOLUMN_NAME String => primary key column name being imported
- FKTABLE_CAT String => foreign key table catalog (may be null)
- FKTABLE_SCHEM String => foreign key table schema (may be null)
- FKTABLE_NAME String => foreign key table name
- FKCOLUMN_NAME String => foreign key column name
- KEY_SEQ short => sequence number within foreign key
- UPDATE_RULE short => What happens to foreign key when primary is updated:
- importedNoAction - do not allow update of primary key if it has been imported
- importedKeyCascade - change imported key to agree with primary key update
- importedKeySetNull - change imported key to NULL if its primary key has been updated
- importedKeySetDefault - change imported key to default values if its primary key has been updated
- importedKeyRestrict - same as importedKeyNoAction (for ODBC 2.x compatibility)
- DELETE_RULE short => What happens to the foreign key when primary is deleted.
- importedKeyNoAction - do not allow delete of primary key if it has been imported
- importedKeyCascade - delete rows that import a deleted key
- importedKeySetNull - change imported key to NULL if its primary key has been deleted
- importedKeyRestrict - same as importedKeyNoAction (for ODBC 2.x compatibility)
- importedKeySetDefault - change imported key to default if its primary key has been deleted
- FK_NAME String => foreign key name (may be null)
- PK_NAME String => primary key name (may be null)
- DEFERRABILITY short => can the evaluation of foreign key constraints be deferred until commit
- importedKeyInitiallyDeferred - see SQL92 for definition
- importedKeyInitiallyImmediate - see SQL92 for definition
- importedKeyNotDeferrable - see SQL92 for definition
ResultSet- each row is a primary key column description @exception SQLException if a database access error occurs @see #getExportedKeys
Gets a description of a table's indices and statistics. They are ordered by NON_UNIQUE TYPE INDEX_NAME and ORDINAL_POSITION.Class DatabaseMetaData, int getMaxIndexLength()Each index column description has the following columns:
@param catalog a catalog name; "" retrieves those without a catalog; null means drop catalog name from the selection criteria @param schema a schema name; "" retrieves those without a schema @param table a table name @param unique when true return only indices for unique values; when false return indices regardless of whether unique or not @param approximate when true result is allowed to reflect approximate or out of data values; when false results are requested to be accurate @return
- TABLE_CAT String => table catalog (may be null)
- TABLE_SCHEM String => table schema (may be null)
- TABLE_NAME String => table name
- NON_UNIQUE boolean => Can index values be non-unique false when TYPE is tableIndexStatistic
- INDEX_QUALIFIER String => index catalog (may be null); null when TYPE is tableIndexStatistic
- INDEX_NAME String => index name; null when TYPE is tableIndexStatistic
- TYPE short => index type:
- tableIndexStatistic - this identifies table statistics that are returned in conjuction with a table's index descriptions
- tableIndexClustered - this is a clustered index
- tableIndexHashed - this is a hashed index
- tableIndexOther - this is some other style of index
- ORDINAL_POSITION short => column sequence number within index; zero when TYPE is tableIndexStatistic
- COLUMN_NAME String => column name; null when TYPE is tableIndexStatistic
- ASC_OR_DESC String => column sort sequence "A" => ascending "D" => descending may be null if sort sequence is not supported; null when TYPE is tableIndexStatistic
- CARDINALITY int => When TYPE is tableIndexStatistic then this is the number of rows in the table; otherwise it is the number of unique values in the index.
- PAGES int => When TYPE is tableIndexStatisic then this is the number of pages used for the table otherwise it is the number of pages used for the current index.
- FILTER_CONDITION String => Filter condition if any. (may be null)
ResultSet- each row is an index column description @exception SQLException if a database access error occurs
Class DatabaseMetaData, int getMaxStatementLength()What'sRetrieves the maximumlengthnumber of bytes for an index(inincludingbytes)all of the parts of the index. @return max index length in bytes which includes the composite of all the constituent parts of the index; a result of zero means that there is no limit or the limit is not known @exception SQLException if a database access error occurs
What's the maximum length ofClass DatabaseMetaData, ResultSet getPrimaryKeys(String, String, String)aan SQL statement @return max length in bytes; a result of zero means that there is no limit or the limit is not known @exception SQLException if a database access error occurs
Gets a description of a table's primary key columns. They are ordered by COLUMN_NAME.Class DatabaseMetaData, ResultSet getProcedureColumns(String, String, String, String)Each primary key column description has the following columns:
@param catalog a catalog name; "" retrieves those without a catalog; null means drop catalog name from the selection criteria @param schema a schema name; "" retrieves those without a schema @param table a table name @return
- TABLE_CAT String => table catalog (may be null)
- TABLE_SCHEM String => table schema (may be null)
- TABLE_NAME String => table name
- COLUMN_NAME String => column name
- KEY_SEQ short => sequence number within primary key
- PK_NAME String => primary key name (may be null)
ResultSet- each row is a primary key column description @exception SQLException if a database access error occurs
Gets a description of a catalog's stored procedure parameters and result columns.Class DatabaseMetaData, ResultSet getProcedures(String, String, String)Only descriptions matching the schema procedure and parameter name criteria are returned. They are ordered by PROCEDURE_SCHEM and PROCEDURE_NAME. Within this the return value if any is first. Next are the parameter descriptions in call order. The column descriptions follow in column number order.
Each row in the
ResultSetis a parameter description or column description with the following fields:
- PROCEDURE_CAT String => procedure catalog (may be null)
- PROCEDURE_SCHEM String => procedure schema (may be null)
- PROCEDURE_NAME String => procedure name
- COLUMN_NAME String => column/parameter name
- COLUMN_TYPE Short => kind of column/parameter:
- procedureColumnUnknown - nobody knows
- procedureColumnIn - IN parameter
- procedureColumnInOut - INOUT parameter
- procedureColumnOut - OUT parameter
- procedureColumnReturn - procedure return value
- procedureColumnResult - result column in
ResultSet- DATA_TYPE short => SQL type from java.sql.Types
- TYPE_NAME String => SQL type name for a UDT type the type name is fully qualified
- PRECISION int => precision
- LENGTH int => length in bytes of data
- SCALE short => scale
- RADIX short => radix
- NULLABLE short => can it contain NULL
- procedureNoNulls - does not allow NULL values
- procedureNullable - allows NULL values
- procedureNullableUnknown - nullability unknown
- REMARKS String => comment describing parameter/column
Note: Some databases may not return the column descriptions for a procedure. Additional columns beyond REMARKS can be defined by the database. @param catalog a catalog name; "" retrieves those without a catalog; null means drop catalog name from the selection criteria @param schemaPattern a schema name pattern; "" retrieves those without a schema @param procedureNamePattern a procedure name pattern @param columnNamePattern a column name pattern @return
ResultSet- each row describes a stored procedure parameter or column @exception SQLException if a database access error occurs @see #getSearchStringEscape
Gets a description of the stored procedures available in a catalog.Class DatabaseMetaData, ResultSet getSchemas()Only procedure descriptions matching the schema and procedure name criteria are returned. They are ordered by PROCEDURE_SCHEM and PROCEDURE_NAME.
Each procedure description has the the following columns:
@param catalog a catalog name; "" retrieves those without a catalog; null means drop catalog name from the selection criteria @param schemaPattern a schema name pattern; "" retrieves those without a schema @param procedureNamePattern a procedure name pattern @return
- PROCEDURE_CAT String => procedure catalog (may be null)
- PROCEDURE_SCHEM String => procedure schema (may be null)
- PROCEDURE_NAME String => procedure name
- reserved for future use
- reserved for future use
- reserved for future use
- REMARKS String => explanatory comment on the procedure
- PROCEDURE_TYPE short => kind of procedure:
- procedureResultUnknown - May return a result
- procedureNoResult - Does not return a result
- procedureReturnsResult - Returns a result
ResultSet- each row is a procedure description @exception SQLException if a database access error occurs @see #getSearchStringEscape
Gets the schema names available in this database. The results are ordered by schema name.Class DatabaseMetaData, ResultSet getTablePrivileges(String, String, String)The schema column is:
@return
- TABLE_SCHEM String => schema name
ResultSet- each row has a single String column that is a schema name @exception SQLException if a database access error occurs
Gets a description of the access rights for each table available in a catalog. Note that a table privilege applies to one or more columns in the table. It would be wrong to assume that this priviledge applies to all columns (this may be true for some systems but is not true for all.)Class DatabaseMetaData, ResultSet getTableTypes()Only privileges matching the schema and table name criteria are returned. They are ordered by TABLE_SCHEM TABLE_NAME and PRIVILEGE.
Each privilige description has the following columns:
@param catalog a catalog name; "" retrieves those without a catalog; null means drop catalog name from the selection criteria @param schemaPattern a schema name pattern; "" retrieves those without a schema @param tableNamePattern a table name pattern @return
- TABLE_CAT String => table catalog (may be null)
- TABLE_SCHEM String => table schema (may be null)
- TABLE_NAME String => table name
- GRANTOR => grantor of access (may be null)
- GRANTEE String => grantee of access
- PRIVILEGE String => name of access (SELECT INSERT UPDATE REFRENCES ...)
- IS_GRANTABLE String => "YES" if grantee is permitted to grant to others; "NO" if not; null if unknown
ResultSet- each row is a table privilege description @exception SQLException if a database access error occurs @see #getSearchStringEscape
Gets the table types available in this database. The results are ordered by table type.Class DatabaseMetaData, ResultSet getTables(String, String, String, String[])The table type is:
@return
- TABLE_TYPE String => table type. Typical types are "TABLE" "VIEW" "SYSTEM TABLE" "GLOBAL TEMPORARY" "LOCAL TEMPORARY" "ALIAS" "SYNONYM".
ResultSet- each row has a single String column that is a table type @exception SQLException if a database access error occurs
Gets a description of tables available in a catalog.Class DatabaseMetaData, ResultSet getTypeInfo()Only table descriptions matching the catalog schema table name and type criteria are returned. They are ordered by TABLE_TYPE TABLE_SCHEM and TABLE_NAME.
Each table description has the following columns:
- TABLE_CAT String => table catalog (may be null)
- TABLE_SCHEM String => table schema (may be null)
- TABLE_NAME String => table name
- TABLE_TYPE String => table type. Typical types are "TABLE" "VIEW" "SYSTEM TABLE" "GLOBAL TEMPORARY" "LOCAL TEMPORARY" "ALIAS" "SYNONYM".
- REMARKS String => explanatory comment on the table
Note: Some databases may not return information for all tables. @param catalog a catalog name; "" retrieves those without a catalog; null means drop catalog name from the selection criteria @param schemaPattern a schema name pattern; "" retrieves those without a schema @param tableNamePattern a table name pattern @param types a list of table types to include; null returns all types @return
ResultSet- each row is a table description @exception SQLException if a database access error occurs @see #getSearchStringEscape
Gets a description of all the standard SQL types supported by this database. They are ordered by DATA_TYPE and then by how closely the data type maps to the corresponding JDBC SQL type.Class DatabaseMetaData, ResultSet getUDTs(String, String, String, int[])Each type description has the following columns:
@return
- TYPE_NAME String => Type name
- DATA_TYPE short => SQL data type from java.sql.Types
- PRECISION int => maximum precision
- LITERAL_PREFIX String => prefix used to quote a literal (may be null)
- LITERAL_SUFFIX String => suffix used to quote a literal (may be null)
- CREATE_PARAMS String => parameters used in creating the type (may be null)
- NULLABLE short => can you use NULL for this type
- typeNoNulls - does not allow NULL values
- typeNullable - allows NULL values
- typeNullableUnknown - nullability unknown
- CASE_SENSITIVE boolean=> is it case sensitive
- SEARCHABLE short => can you use "WHERE" based on this type:
- typePredNone - No support
- typePredChar - Only supported with WHERE .. LIKE
- typePredBasic - Supported except for WHERE .. LIKE
- typeSearchable - Supported for all WHERE ..
- UNSIGNED_ATTRIBUTE boolean => is it unsigned
- FIXED_PREC_SCALE boolean => can it be a money value
- AUTO_INCREMENT boolean => can it be used for an auto-increment value
- LOCAL_TYPE_NAME String => localized version of type name (may be null)
- MINIMUM_SCALE short => minimum scale supported
- MAXIMUM_SCALE short => maximum scale supported
- SQL_DATA_TYPE int => unused
- SQL_DATETIME_SUB int => unused
- NUM_PREC_RADIX int => usually 2 or 10
ResultSet- each row isaan SQL type description @exception SQLException if a database access error occurs
Class DatabaseMetaData, ResultSet getVersionColumns(String, String, String)JDBC 2.0Gets a description of the user-defined types defined in a particular schema. Schema-specific UDTs may have type JAVA_OBJECT STRUCT or DISTINCT.Only types matching the catalog schema type name and type criteria are returned. They are ordered by DATA_TYPE TYPE_SCHEM and TYPE_NAME. The type name parameter may be a fully-qualified name. In this case the catalog and schemaPattern parameters are ignored.
Each type description has the following columns:
- TYPE_CAT String => the type's catalog (may be null)
- TYPE_SCHEM String => type's schema (may be null)
- TYPE_NAME String => type name
- CLASS_NAME String => Java class name
- DATA_TYPE String => type value defined in java.sql.Types. One of JAVA_OBJECT STRUCT or DISTINCT
- REMARKS String => explanatory comment on the type
Note: If the driver does not support UDTs an empty result set is returned. @param catalog a catalog name; "" retrieves those without a catalog; null means drop catalog name from the selection criteria @param schemaPattern a schema name pattern; "" retrieves those without a schema @param typeNamePattern a type name pattern; may be a fully-qualified name @param types a list of user-named types to include (JAVA_OBJECT STRUCT or DISTINCT); null returns all types @return
ResultSet- each row is a type description @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Gets a description of a table's columns that are automatically updated when any value in a row is updated. They are unordered.Class DatabaseMetaData, boolean insertsAreDetected(int)Each column description has the following columns:
@param catalog a catalog name; "" retrieves those without a catalog; null means drop catalog name from the selection criteria @param schema a schema name; "" retrieves those without a schema @param table a table name @return
- SCOPE short => is not used
- COLUMN_NAME String => column name
- DATA_TYPE short => SQL data type from java.sql.Types
- TYPE_NAME String => Data source dependent type name
- COLUMN_SIZE int => precision
- BUFFER_LENGTH int => length of column value in bytes
- DECIMAL_DIGITS short => scale
- PSEUDO_COLUMN short => is this a pseudo column like an Oracle ROWID
- versionColumnUnknown - may or may not be pseudo column
- versionColumnNotPseudo - is NOT a pseudo column
- versionColumnPseudo - is a pseudo column
ResultSet- each row is a column description @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean nullPlusNonNullIsNull()JDBC 2.0Indicates whether or not a visible row insert can be detected by calling ResultSet.rowInserted(). @param result set type i.e. ResultSet.TYPE_XXX @return true if changes are detected by the resultset type @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Are concatenations between NULL and non-NULL values NULLClass DatabaseMetaData, boolean othersDeletesAreVisible(int)AFor SQL-92 compliance a JDBCCompliantTMtechnology-enabled driveralways returnswill returntrue. @returntrueif so;falseotherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean othersInsertsAreVisible(int)JDBC 2.0Indicates whether deletes made by others are visible. @param result set type i.e. ResultSet.TYPE_XXX @returntrueif deletes made by others are visible for the result set type;falseotherwise @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class DatabaseMetaData, boolean othersUpdatesAreVisible(int)JDBC 2.0Indicates whether inserts made by others are visible. @param result set type i.e. ResultSet.TYPE_XXX @return true if updates are visible for the result set type @returntrueif inserts made by others are visible for the result set type;falseotherwise @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class DatabaseMetaData, boolean ownDeletesAreVisible(int)JDBC 2.0Indicates whether updates made by others are visible. @param result set type i.e. ResultSet.TYPE_XXX @returntrueif updates made by others are visible for the result set type;falseotherwise @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class DatabaseMetaData, boolean ownInsertsAreVisible(int)JDBC 2.0Indicates whether a result set's own deletes are visible. @param result set type i.e. ResultSet.TYPE_XXX @returntrueif deletes are visible for the result set type;falseotherwise @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class DatabaseMetaData, boolean ownUpdatesAreVisible(int)JDBC 2.0Indicates whether a result set's own inserts are visible. @param result set type i.e. ResultSet.TYPE_XXX @returntrueif inserts are visible for the result set type;falseotherwise @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class DatabaseMetaData, boolean supportsBatchUpdates()JDBC 2.0Indicates whether a result set's own updates are visible. @param result set type i.e. ResultSet.TYPE_XXX @returntrueif updates are visible for the result set type;falseotherwise @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class DatabaseMetaData, boolean supportsMultipleResultSets()JDBC 2.0Indicates whether the driver supports batch updates. @return true if the driver supports batch updates; false otherwise @since 1.2 @see What Is in the JDBC 2.0 API
Are multipleClass DatabaseMetaData, boolean supportsResultSetConcurrency(int, int)ResultSetsResultSetfrom a single execute supported @returntrueif so;falseotherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsResultSetType(int)JDBC 2.0Does the database support the concurrency type in combination with the given result set type @param type defined injava.sql.ResultSet@param concurrency type defined injava.sql.ResultSet@returntrueif so;falseotherwise @exception SQLException if a database access error occurs @see Connection @since 1.2 @see What Is in the JDBC 2.0 API
Class DatabaseMetaData, boolean updatesAreDetected(int)JDBC 2.0Does the database support the given result set type @param type defined injava.sql.ResultSet@returntrueif so;falseotherwise @exception SQLException if a database access error occurs @see Connection @since 1.2 @see What Is in the JDBC 2.0 API
JDBC 2.0Indicates whether or not a visible row update can be detected by calling the methodResultSet.rowUpdated. @param result set type i.e. ResultSet.TYPE_XXX @returntrueif changes are detected by the result set type;falseotherwise @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Formats a date inJDBCthe date escape format yyyy-mm-dd.NOTE: To specify a date format for the class
. For example:SimpleDateFormatuse "yyyy.MM.dd" rather than "yyyy-mm-dd". In the context ofSimpleDateFormat"mm" indicates minutes rather than the monthFormat Pattern Result -------------- ------- "yyyy.MM.dd G 'at' hh:mm:ss z" ->> 1996.07.10 AD at 15:08:56 PDT@return a String in yyyy-mm-dd format
Class DriverManager, void deregisterDriver(Driver)The basic service for managing a set of JDBC drivers.
NOTE: TheDataSourceinterface new in the JDBC 2.0 API provides another way to connect to a data source. The use of aDataSourceobject is the preferred means of connecting to a data source.As part of its initialization the
DriverManagerclass will attempt to load the driver classes referenced in the "jdbc.drivers" system property. This allows a user to customize the JDBC Drivers used by their applications. For example in your ~/.hotjava/properties file you might specify:A program can also explicitly load JDBC drivers at any time. For example the my.sql.Driver is loaded with the following statement:jdbc.drivers=foo.bah.Driver:wombat.sql.Driver:bad.taste.ourDriverClass.forName("my.sql.Driver");When the method
getConnectionis called theDriverManagerwill attempt to locate a suitable driver from amongst those loaded at initialization and those loaded explicitly using the same classloader as the current applet or application.Starting with the Java 2 SDK Standard Edition version 1.3 a logging stream can be set only if the proper permission has been granted. Normally this will be done with the tool PolicyTool which can be used to grant
permission java.sql.SQLPermission "setLog". @see Driver @see ConnectionSome methods in this class are new in the JDBC 2.0 API. They are marked with "since 1.2". API marked "since 1.3" is new in the JDBC 2.0 API and is included in the Java 2 SDK Standard Edition version 1.3.
Drops a Driver from the DriverManager's list. Applets can only deregister Drivers from their own classloaders. @param driver the JDBC Driver to drop @exception SQLException if a database access error occurs
Class DriverManager, Connection getConnection(String)Attempts to establish a connection to the given database URL. TheClass DriverManager, Connection getConnection(String, Properties)DriverManagerattempts to select an appropriate driver from the set of registered JDBC drivers. @param url a database url of the formjdbc:subprotocol:subname@return aConnectionconnection to the URL @exception SQLException if a database access error occurs
Attempts to establish a connection to the given database URL. TheClass DriverManager, Connection getConnection(String, String, String)DriverManagerattempts to select an appropriate driver from the set of registered JDBC drivers. @param url a database url of the formjdbc:subprotocol:subname@param info a list of arbitrary string tag/value pairs as connection arguments; normally at least a "user" and "password" property should be included @return a Connection to the URL @exception SQLException if a database access error occurs
Attempts to establish a connection to the given database URL. TheClass DriverManager, Driver getDriver(String)DriverManagerattempts to select an appropriate driver from the set of registered JDBC drivers. @param url a database url of the formjdbc:subprotocol:subname@param user the database user on whose behalf theConnectionconnection is being made @param password the user's password @return aConnectionconnection to the URL @exception SQLException if a database access error occurs
Attempts to locate a driver that understands the given URL. TheClass DriverManager, PrintStream getLogStream()DriverManagerattempts to select an appropriate driver from the set of registered JDBC drivers. @param url a databaseurlURL of the formjdbc:subprotocol:subname@return aDriverobject representing a driver that can connect to the given URL @exception SQLException if a database access error occurs
Gets the logging/tracing PrintStream that is used by theClass DriverManager, PrintWriter getLogWriter()DriverManagerand all drivers. @return the logging/tracing PrintStream; if disabled isnull@deprecated
Class DriverManager, void registerDriver(Driver)JDBC 2.0Gets the log writer. ThegetLogWriterandsetLogWritermethods should be used instead of theoldget/setlogStreammethods which are deprecated. @return ajava.io.PrintWriterobject @see What Is in the JDBC 2.0 API @since 1.2
Registers the given driver with theClass DriverManager, void setLogStream(PrintStream)DriverManager. A newly-loaded driver class should call the methodregisterDriverto make itself known to theDriverManager. @param driver the new JDBC Driver that is to be registered with theDriverManager@exception SQLException if a database access error occurs
Sets the logging/tracing PrintStream that is used by theClass DriverManager, void setLogWriter(PrintWriter)DriverManagerand all drivers.In the Java 2 SDK Standard Edition version 1.3 release this method checks to see that there is an
SQLPermissionobject before setting the logging stream. If aSecurityManagerexists and itscheckPermissionmethod denies setting the log writer this method throws ajava.lang.SecurityException. @param out the new logging/tracing PrintStream; to disable set tonull@deprecated @throws SecurityException if a security manager exists and itscheckPermissionmethod denies setting the log stream. @see SecurityManager#checkPermission
JDBC 2.0Sets the logging/tracingWriterPrintWriterobject that is used by theDriverManagerand all drivers.There is a minor versioning problem
introducedcreated by the introduction of the method setLogWriter. The methodsetLogWritercannot create aPrintStreamobject that will be returned bygetLogStream---the Java platform does not provide a backward conversion.SoAs a result a new application that usessetLogWriterand also uses a JDBC 1.0 driver that usesgetLogStreamwill likely not see debugging information written by that driver.In the Java 2 SDK Standard Edition version 1.3 release this method checks to see that there is an
SQLPermissionobject before setting the logging stream. If aSecurityManagerexists and itscheckPermissionmethod denies setting the log writer this method throws ajava.lang.SecurityException. @param out the new logging/tracingPrintStreamobject;nullto disablesetlogging andtotracingnull@throws SecurityException if a security manager exists and itscheckPermissionmethod denies setting the log writer @see SecurityManager#checkPermission @see What Is in the JDBC 2.0 API @since 1.2
An object that represents a precompiled SQL statement.Class PreparedStatement, void addBatch()A SQL statement is
pre-compiledprecompiled and stored in aPreparedStatementobject. This object can then be used to efficiently execute this statement multiple times.Note: The setXXX methods for setting IN parameter values must specify types that are compatible with the defined SQL type of the input parameter. For instance if the IN parameter has SQL type
Integerthen the methodsetIntshould be used.If arbitrary parameter type conversions are required the method
setObjectshould be used with a target SQL type.
Example of setting a parameter;conis an active connection@see Connection#prepareStatement @see ResultSetPreparedStatement pstmt = con.prepareStatement("UPDATE EMPLOYEES SET SALARY = WHERE ID = "); pstmt.setBigDecimal(1 153833.00) pstmt.setInt(2 110592)Some of the methods in this interface are new in the JDBC 2.0 API.
Class PreparedStatement, void clearParameters()JDBC 2.0Adds a set of parameters tothethisPreparedStatementobject's batch of commands. @exception SQLException if a database access error occurs @see Statement#addBatch @since 1.2 @see What Is in the JDBC 2.0 API
Clears the current parameter values immediately.Class PreparedStatement, boolean execute()In general parameter values remain in force for repeated use of a
Statementstatement. 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 the methodclearParameters. @exception SQLException if a database access error occurs
Executes any kind of SQL statement. Some prepared statements return multiple results; theClass PreparedStatement, ResultSet executeQuery()executemethod handles these complex statements as well as the simpler form of statements handled by the methodsexecuteQuery andexecuteUpdate. @exception SQLException if a database access error occurs @see Statement#execute
Executes the SQL query in thisClass PreparedStatement, ResultSetMetaData getMetaData()PreparedStatementobject and returns the result set generated by the query. @return aResultSetobject that contains the data produced by the query; nevernull@exception SQLException if a database access error occurs
Class PreparedStatement, void setArray(int, Array)JDBC 2.0Gets the number types and properties of aResultSetobject's columns. @return the description of aResultSetobject's columns @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class PreparedStatement, void setAsciiStream(int, InputStream, int)JDBCSets2the designated parameter to the givenArrayobject.0Sets an Array parameter. @param i the first parameter is 1 the second is 2 ... @param x anArrayobjectrepresentingthat maps an SQLarrayARRAYvalue @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Sets the designated parameter to the given input stream which will have the specified number of bytes. When a very large ASCII value is input to aClass PreparedStatement, void setBigDecimal(int, BigDecimal)LONGVARCHARparameter it may be more practical to send it via ajava.io.InputStream.JDBCData willread thebedataread from the stream as needed untilit reachesend-of-file is reached. The JDBC driver will do any necessary conversion from ASCII 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. @param parameterIndex the first parameter is 1 the second is 2 ... @param x the Java input stream that contains the ASCII parameter value @param length the number of bytes in the stream @exception SQLException if a database access error occurs
Sets the designated parameter to aClass PreparedStatement, void setBinaryStream(int, InputStream, int)java.value. The driver converts this to an SQLlangmath.BigDecimalNUMERICvalue when it sends it to the database. @param parameterIndex the first parameter is 1 the second is 2 ... @param x the parameter value @exception SQLException if a database access error occurs
Sets the designated parameter to the given input stream which will have the specified number of bytes. When a very large binary value is input to aClass PreparedStatement, void setBlob(int, Blob)LONGVARBINARYparameter it may be more practical to send it via ajava.io.InputStreamobject.JDBC will read the dataThe data will be read from the stream as needed untilit reachesend-of-file is reached.Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface. @param parameterIndex the first parameter is 1 the second is 2 ... @param x the java input stream which contains the binary parameter value @param length the number of bytes in the stream @exception SQLException if a database access error occurs
Class PreparedStatement, void setBoolean(int, boolean)JDBC 2.0Setsa BLOBthe designated parameter to the givenBlobobject. @param i the first parameter is 1 the second is 2 ... @param xanaBlobobjectrepresentingthatamaps an SQLBLOB value @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Sets the designated parameter to a JavaClass PreparedStatement, void setByte(int, byte)booleanvalue. The driver converts this to an SQLBITvalue when it sends it to the database. @param parameterIndex the first parameter is 1 the second is 2 ... @param x the parameter value @exception SQLException if a database access error occurs
Sets the designated parameter to a JavaClass PreparedStatement, void setBytes(int, byte[])bytevalue. The driver converts this to an SQLTINYINTvalue when it sends it to the database. @param parameterIndex the first parameter is 1 the second is 2 ... @param x the parameter value @exception SQLException if a database access error occurs
Sets the designated parameter to a Java array of bytes. The driver converts this to an SQLClass PreparedStatement, void setCharacterStream(int, Reader, int)VARBINARYorLONGVARBINARY(depending on the argument's size relative to the driver's limits onVARBINARYsVARBINARYvalues) when it sends it to the database. @param parameterIndex the first parameter is 1 the second is 2 ... @param x the parameter value @exception SQLException if a database access error occurs
Class PreparedStatement, void setClob(int, Clob)JDBC 2.0Sets the designated parameter to the givenReaderobject which is the given number of characters long. When a very large UNICODE value is input to aLONGVARCHARparameter it may be more practical to send it via ajava.io.Readerobject.JDBC will read the dataThe data will be read from the stream as needed untilit reachesend-of-file is reached. 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. @param parameterIndex the first parameter is 1 the second is 2 ... @param x the java reader which contains the UNICODE data @param length the number of characters in the stream @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class PreparedStatement, void setDate(int, Date)JDBC 2.0Setsa CLOBthe designated parameter to the givenClobobject. @param i the first parameter is 1 the second is 2 ... @param xanaClobobjectrepresentingthatamaps an SQLCLOB value @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Sets the designated parameter to aClass PreparedStatement, void setDate(int, Date, Calendar)java.sql.Datevalue. The driver converts this to an SQLDATEvalue when it sends it to the database. @param parameterIndex the first parameter is 1 the second is 2 ... @param x the parameter value @exception SQLException if a database access error occurs
Class PreparedStatement, void setDouble(int, double)JDBC 2.0Sets the designated parameter toathe givenjava.sql.Datevalue using the givenCalendarobject. The driver uses theCalendarobject to construct an SQLDATEvalue which the driver then sends to the database. With a aCalendarobject the driver can calculate the date taking into account a custom timezoneand locale. If noCalendarobject is specified the driver uses the default timezoneandwhich is that of the virtual machine running thelocaleapplication. @param parameterIndex the first parameter is 1 the second is 2 ... @param x the parameter value @param cal theCalendarobject the driver will use to construct the date @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Sets the designated parameter to a JavaClass PreparedStatement, void setFloat(int, float)doublevalue. The driver converts this to an SQLDOUBLEvalue when it sends it to the database. @param parameterIndex the first parameter is 1 the second is 2 ... @param x the parameter value @exception SQLException if a database access error occurs
Sets the designated parameter to a JavaClass PreparedStatement, void setInt(int, int)floatvalue. The driver converts this to an SQLFLOATvalue when it sends it to the database. @param parameterIndex the first parameter is 1 the second is 2 ... @param x the parameter value @exception SQLException if a database access error occurs
Sets the designated parameter to a JavaClass PreparedStatement, void setLong(int, long)intvalue. The driver converts this to an SQLINTEGERvalue when it sends it to the database. @param parameterIndex the first parameter is 1 the second is 2 ... @param x the parameter value @exception SQLException if a database access error occurs
Sets the designated parameter to a JavaClass PreparedStatement, void setNull(int, int)longvalue. The driver converts this to an SQLBIGINTvalue when it sends it to the database. @param parameterIndex the first parameter is 1 the second is 2 ... @param x the parameter value @exception SQLException if a database access error occurs
Sets the designated parameter to SQLClass PreparedStatement, void setNull(int, int, String)NULL.Note: You must specify the parameter's SQL type. @param parameterIndex the first parameter is 1 the second is 2 ... @param sqlType the SQL type code defined in
java.sql.Types@exception SQLException if a database access error occurs
Class PreparedStatement, void setObject(int, Object)JDBC 2.0Sets the designated parameter to SQLNULL. This version of the methodsetNull should be used for user-nameddefined types and REF type parameters. Examples of user-nameddefined 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-
nameddefined 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-nameddefined 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-nameddefined or REF type the given typeName is ignored. @param parameterIndex the first parameter is 1 the second is 2 ... @param sqlType a value fromjava.sql.Types@param typeName the fully-qualified name of an SQL user-nameddefined type; ignored if the parameter is not a user-nameddefined type or REF @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class PreparedStatement, void setObject(int, Object, int)Sets the value of
athe designated parameter usinganthe given object. The second parameter must be of typeObject;usetherefore thejava.langequivalent objects should be used forintegralbuilt-invaluestypes.The JDBC specification specifies a standard mapping from Java
Objecttypes to SQL types. The given argumentjava objectwill 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
Driverdriver-specific Java type. If the object is of a class implementing the interfaceSQLData the JDBC driver should callitsthe methodSQLData.writeSQLto write it to the SQL data stream. If on the other hand the object is of a class implementing Ref Blob Clob Struct or Array then the driver should pass it to the database as a value of the corresponding SQL type. This method throws an exception if there is an ambiguity for example if the object is of a class implementing more than one ofthosethe interfaces named above. @param parameterIndex the first parameter is 1 the second is 2 ... @param x the object containing the input parameter value @exception SQLException if a database access error occurs
Sets the value of the designated parameter with the given object. This method is like the method setObject above except that it assumes a scale of zero. @param parameterIndex the first parameter is 1 the second is 2 ... @param x the object containing the input parameter value @param targetSqlType the SQL type (as defined in java.sql.Types) to be sent to the database @exception SQLException if a database access error occurs
Class PreparedStatement, void setObject(int, Object, int, int)Class PreparedStatement, void setRef(int, Ref)Sets the value of
athe designated parameterusing anwith the given object. The second argument must be an object type; for integral values thejava.langequivalent objects should be used.The given Java object will be converted to the given targetSqlType before being sent to the database. If the object has a custom mapping (is of a class implementing the interface
SQLData) the JDBC driver should callitsthe methodSQLData.writeSQLto write it to the SQL data stream. If on the other hand the object is of a class implementing Ref Blob Clob Struct or Array the driver should 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. @param parameterIndex the first parameter is 1 the second is 2 ... @param x the object containing the input parameter value @param targetSqlType the SQL type (as defined in java.sql.Types) to be sent to the database. The scale argument may further qualify this type. @param scale for java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types this is the number of digits after the decimal point. For all other types this value will be ignored. @exception SQLException if a database access error occurs @see Types
Class PreparedStatement, void setShort(int, short)JDBCSets2.0theSetsdesignatedaparameter to the givenREF(<structured-type>)parametervalue. @param i the first parameter is 1 the second is 2 ... @param x anobject representing data of anSQLREFTypevalue @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Sets the designated parameter to a JavaClass PreparedStatement, void setString(int, String)shortvalue. The driver converts this to an SQLSMALLINTvalue when it sends it to the database. @param parameterIndex the first parameter is 1 the second is 2 ... @param x the parameter value @exception SQLException if a database access error occurs
Sets the designated parameter to a JavaClass PreparedStatement, void setTime(int, Time)Stringvalue. The driver converts this to an SQLVARCHARorLONGVARCHARvalue (depending on the argument's size relative to the driver's limits onVARCHARsVARCHARvalues) when it sends it to the database. @param parameterIndex the first parameter is 1 the second is 2 ... @param x the parameter value @exception SQLException if a database access error occurs
Sets the designated parameter to aClass PreparedStatement, void setTime(int, Time, Calendar)java.sql.Timevalue. The driver converts this to an SQLTIMEvalue when it sends it to the database. @param parameterIndex the first parameter is 1 the second is 2 ... @param x the parameter value @exception SQLException if a database access error occurs
Class PreparedStatement, void setTimestamp(int, Timestamp)JDBC 2.0Sets the designated parameter toathe givenjava.sql.Timevalue using the givenCalendarobject. The driver uses theCalendarobject to construct an SQLTIMEvalue which the driver then sends to the database. With a aCalendarobject the driver can calculate the time taking into account a custom timezoneand locale. If noCalendarobject is specified the driver uses the default timezoneandwhich is that of the virtual machine running thelocaleapplication. @param parameterIndex the first parameter is 1 the second is 2 ... @param x the parameter value @param cal theCalendarobject the driver will use to construct the time @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Sets the designated parameter to aClass PreparedStatement, void setTimestamp(int, Timestamp, Calendar)java.sql.Timestampvalue. The driver converts this to an SQLTIMESTAMPvalue when it sends it to the database. @param parameterIndex the first parameter is 1 the second is 2 ... @param x the parameter value @exception SQLException if a database access error occurs
Class PreparedStatement, void setUnicodeStream(int, InputStream, int)JDBC 2.0Sets the designated parameter toathe givenjava.sql.Timestampvalue using the givenCalendarobject. The driver uses theCalendarobject to construct an SQLTIMESTAMPvalue which the driver then sends to the database. With a aCalendarobject the driver can calculate the timestamp taking into account a custom timezoneand locale. If noCalendarobject is specified the driver uses the default timezoneandwhich is that of the virtual machine running thelocaleapplication. @param parameterIndex the first parameter is 1 the second is 2 ... @param x the parameter value @param cal theCalendarobject the driver will use to construct the timestamp @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Sets the designated parameter to the given input stream which will have the specified number of bytes. When a very large UNICODE value is input to aLONGVARCHARparameter it may be more practical to send it via ajava.io.InputStreamobject.JDBC will read the dataThe data will be read from the stream as needed untilit reachesend-of-file is reached. The JDBC driver will do any necessary conversion from UNICODE to the database char format. The byte format of the Unicode stream must be Java UTF-8 as defined in the Java Virtual Machine Specification.Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface. @param parameterIndex the first parameter is 1 the second is 2 ... @param x the java input stream which contains the UNICODE parameter value @param length the number of bytes in the stream @exception SQLException if a database access error occurs @deprecated
Class Ref, String getBaseTypeName()JDBCThe2.0mappingAin the Java programming language of an SQLREFvalue which is a reference to an SQL structured type value in the database.SQL
REFvalues are stored in a special table that contains instances of a referenceable SQL structured type and eachREFvalue is a unique identifier for one instance in that table. An SQLREFvalue may be used in place of the SQL structured type it references; it may be used as either a column value in a table or an attribute value in a structured type.Because an SQL
REFvalue is a logical pointer to an SQL structured type aRefobject is by default also a logical pointer; thus retrieving an SQLREFvalue as aRefobject does not materialize the attributes of the structured type on the client.A
Refobject can be saved to persistent storage. ARefand is dereferenced by passing it as a parameter to an SQL statement and executing the statement.The
Refinterface is new in the JDBC 2.0 API. @see Struct
GetsRetrieves the fully-qualified SQL name of the SQL structured typename ofthat thistheRefreferenced itemobject references. @return the fully-qualified SQLstructured typename of the referenceditem.SQL structured type @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
AClass ResultSet, boolean absolute(int)ResultSet provides access totable of data representing atable of data.databaseA ResultSet objectresult set which is usually generated by executing aStatementstatement that queries the database.A
ResultSetobject maintains a cursor pointing to its current row of data. Initially the cursor is positioned before the first row. The'nextmethod moves the cursor to the next row and because it returns'falsewhen there are no more rows in theResultSetobject it can be used in awhileloop to iterate through the result set.A default
ResultSetobject is not updatable and has a cursor that moves forward only. Thus it is possible to iterate through it only once and only from the first row to the last row. New methods in the JDBC 2.0 API make it possible to produceResultSetobjects that are scrollable and/or updatable. The following code fragment in whichconis a validConnectionobject illustrates how to make a result set that is scrollable and insensitive to updates by others and that is updatable. SeeResultSetfields for other options.Statement stmt = con.createStatement( ResultSet.TYPE_SCROLL_INSENSITIVE ResultSet.CONCUR_UPDATABLE); ResultSet rs = stmt.executeQuery("SELECT a b FROM TABLE2"); // rs will be scrollable will not show changes made by others // and will be updatableTheResultSetinterface providesgetXXXmethodsretrievefor retrieving column valuesforfrom the current row.YouValues canretrieve valuesbe retrieved using either the index number of the column or the name of the column. In general using the column index will be more efficient. Columns are numbered from 1. For maximum portabilityResultSetresult set columns within each row should be read in left-to-right order and each column should be read only once.For the
getXXXmethodsthea JDBC driver attempts to convert the underlying data to thespecifiedJava type specified in theXXXpart of thegetXXXmethod and returns a suitable Java value.See theThe JDBC specificationforhas a table showing the allowable mappings from SQL types to Java types with theResultSet.getXXXmethods.Column names used as input to
getXXXmethods are case insensitive. WhenperformingagetXXXusingmethod is called with a column nameifand several columns have the same namethenthe 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 that generated the result set. For columns that are NOT explicitly named in the query it is best to use column numbers. If column names are used there is no way for the programmer to guarantee that they actually refer to the intended columns.A set of
updateXXXmethods were added to this interface in the JDBC 2.0 API (JavaTM 2 SDK Standard Edition version 1.2). The comments regarding parameters to thegetXXXmethods also apply to parameters to theupdateXXXmethods.The
updateXXXmethods may be used in two ways:A
- to update a column value in the current row. In a scrollable
ResultSetobject the cursor can be moved backwards and forwards to an absolute position or to a position relative to the current row. The following code fragment updates theNAMEcolumn in the fifth row of theResultSetobjectrsand then uses the methodupdateRowto update the data source table from whichrswas derived.rs.absolute(5); // moves the cursor to the fifth row of rs rs.updateString("NAME" "AINSWORTH"); // updates the //NAMEcolumn of row 5 to beAINSWORTHrs.updateRow(); // updates the row in the data source- to insert column values into the insert row. An updatable
ResultSetobject has a special row associated with it that serves as a staging area for building a row to be inserted. The following code fragment moves the cursor to the insert row builds a three-column row and inserts it intorsand into the data source table using the methodinsertRow.rs.moveToInsertRow(); // moves cursor to the insert row rs.updateString(1 "AINSWORTH"); // updates the // first column of the insert row to beAINSWORTHrs.updateInt(2 35); // updates the second column to be35rs.updateBoolean(3 true); // updates the third row totruers.insertRow(); rs.moveToCurrentRow();ResultSetobject is automatically closedbywhen theStatementobject that generated itwhen that Statementis closed re-executed or used to retrieve the next result from a sequence of multiple results.The number types and properties of a
ResultSetobject's columns are provided by theResulSetMetaDataobject returned by theResultSet.getMetaDatamethod. @see Statement#executeQuery @see Statement#getResultSet @see ResultSetMetaData
Class ResultSet, void afterLast()JDBC 2.0Moves the cursor to the given row number inthethisresultResultSetsetobject.If the row number is positive the cursor moves to the given row number with respect to the beginning of the result set. The first row is row 1 the second is row 2 and so on.
If the given row number is negative the cursor moves to an absolute row position with respect to the end of the result set. For example calling the method
absolute(-1)positions the cursor on the last row; calling the methodabsolute(-2)indicatesmoves the cursor to the next-to-last row and so on.An attempt to position the cursor beyond the first/last row in the result set leaves the cursor before
/afterthe first/lastrowrespectivelyor after the last row.Note: Calling
absolute(1)is the same as callingfirst(). Callingabsolute(-1)is the same as callinglast(). @returntrueif the cursor is on the result set;falseotherwise @exception SQLException if a database access error occursorthe row is0or the result set type isTYPE_FORWARD_ONLY@since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void beforeFirst()JDBC 2.0Moves the cursor to the end ofthethisresultResultSetsetobject just after the last row.HasThis method has no effect if the result set contains no rows. @exception SQLException if a database access error occurs or the result set type isTYPE_FORWARD_ONLY@since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void cancelRowUpdates()JDBC 2.0Moves the cursor to the front ofthethisresultResultSetsetobject just before the first row.HasThis method has no effect if the result set contains no rows. @exception SQLException if a database access error occurs or the result set type isTYPE_FORWARD_ONLY@since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void clearWarnings()JDBC 2.0Cancels the updates made toathe current row in thisResultSetobject. This method may be called after calling anupdateXXXmethod(s) and before calling the methodupdateRowtorollbackroll back the updates made to a row. If no updates have been made orupdateRowhas already been calledthenthis method has no effect. @exception SQLException if a database access error occurs or if this method is called when the cursor is on the insert row @since 1.2 @see What Is in the JDBC 2.0 API
Clears all warnings reported on thisClass ResultSet, void close()ResultSetobject. After thiscallmethod is called the methodgetWarnings returnsnulluntil a new warning is reported for thisResultSetobject. @exception SQLException if a database access error occurs
Releases thisClass ResultSet, void deleteRow()ResultSetobject's database and JDBC resources immediately instead of waiting for this to happen when it is automatically closed.Note: A
ResultSetobject is automatically closed by theStatementobject that generated it when thatStatementobject is closed re-executed or is used to retrieve the next result from a sequence of multiple results. AResultSetobject is also automatically closed when it is garbage collected. @exception SQLException if a database access error occurs
Class ResultSet, int findColumn(String)JDBC 2.0Deletes the current row fromthethisresultResultSetsetobject and from the underlying database.CannotThis method cannot be called when the cursor is on the insert row. @exception SQLException if a database access error occurs or if this method is called when the cursor is on the insert row @since 1.2 @see What Is in the JDBC 2.0 API
Maps the givenClass ResultSet, boolean first()ResultsetResultSetcolumn name to itsResultSetcolumn index. @param columnName the name of the column @return the column index of the given column name @exception SQLException if a database access error occurs
Class ResultSet, Array getArray(String)JDBC 2.0Moves the cursor to the first row inthethisresultResultSetsetobject. @returntrueif the cursor is on a valid row;falseif there are no rows in the result set @exception SQLException if a database access error occurs or the result set type isTYPE_FORWARD_ONLY@since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, Array getArray(int)JDBCReturns2.0theGets an SQL ARRAY valuevalue of the designated column in the current row of thisResultSetobject as anArrayobject in the Java programming language. @param colName the name of the column from which to retrieve the value @return anArrayobject representing the SQLARRAYvalue in the specified column @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, InputStream getAsciiStream(String)JDBCReturns2.0theGets an SQL ARRAY value fromvalue of the designated column in the current row of thisResultSetobject as anArrayobject in the Java programming language. @param i the first column is 1 the second is 2 ... @return anArrayobject representing the SQLARRAYvalue in the specified column @since 1.2 @see What Is in the JDBC 2.0 API
Gets the value ofClass ResultSet, InputStream getAsciiStream(int)athe designated column in the current row of thisResultSetobject as a stream of ASCII characters. The value can then be read in chunks from the stream. This method is particularly suitable for retrieving largeLONGVARCHARvalues. 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
getgetXXXmethod implicitly closes the stream. Also a stream may return0when the methodavailableis called whether there is data available or not. @param columnName the SQL name of the column @return a Java input stream that delivers the database column value as a stream of one-byte ASCII characters. If the value is SQLNULLthethenresultvalue returned isnull. @exception SQLException if a database access error occurs
Gets the value ofClass ResultSet, BigDecimal getBigDecimal(String)athe designated column in the current row of thisResultSetobject as a stream of ASCII characters. The value can then be read in chunks from the stream. This method is particularly suitable for retrieving largeLONGVARCHAR 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
getgetXXXmethod implicitly closes the stream. Also a stream may return0when the methodInputStream.availableis called whether there is data available or not. @param columnIndex the first column is 1 the second is 2 ... @return a Java input stream that delivers the database column value as a stream of one-byte ASCII characters.;Ifif the value is SQLNULLthethenresultvalue returned isnull@exception SQLException if a database access error occurs.
Class ResultSet, BigDecimal getBigDecimal(String, int)JDBC 2.0Gets the value ofathe designated column in the current row of thisResultSetobject as ajava.math.BigDecimalobjectwith full precision. @param columnName the column name @return the column value (full precision); if the value is SQLNULLtheresultvalue returned isnullin the Java programming language. @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Gets the value ofClass ResultSet, BigDecimal getBigDecimal(int)athe designated column in the current row of thisResultSetobject as ajava.math.BigDecimalobjectin the Java programming language. @param columnName the SQL name of the column @param scale the number of digits to the right of the decimal point @return the column value; if the value is SQLNULLtheresultvalue returned isnull@exception SQLException if a database access error occurs @deprecated
Class ResultSet, BigDecimal getBigDecimal(int, int)JDBC 2.0Gets the value ofathe designated column in the current row of thisResultSetobject as ajava.math.BigDecimalobjectwith full precision. @param columnIndex the first column is 1 the second is 2 ... @return the column value (full precision); if the value is SQLNULLtheresultvalue returned isnullin the Java programming language. @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Gets the value ofClass ResultSet, InputStream getBinaryStream(String)athe designated column in the current row of thisResultSetobject as ajava.mathsql.BigDecimalobjectin the Java programming language. @param columnIndex the first column is 1 the second is 2 ... @param scale the number of digits to the right of the decimal point @return the column value; if the value is SQLNULLtheresultvalue returned isnull@exception SQLException if a database access error occurs @deprecated
Gets the value ofClass ResultSet, InputStream getBinaryStream(int)athe designated column in the current row of thisResultSetobject as a stream of uninterpretedbytesbytes. The value can then be read in chunks from the stream. This method is particularly suitable for retrieving largeLONGVARBINARYvalues.The JDBC driver will do any necessary conversion from the database format into uninterpreted bytes.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
getgetXXXmethod implicitly closes the stream. Also a stream may return0when the methodavailableis called whether there is data available or not. @param columnName the SQL name of the column @return a Java input stream that delivers the database column value as a stream of uninterpreted bytes. If; if the value is SQLNULLthe result isthennull@exception SQLException if a database access error occurs.
Gets the value of a column in the current row as a stream of Gets the value of the designated column in the current row of thisClass ResultSet, Blob getBlob(String)ResultSetobject as a binary stream of uninterpreted bytes. The value can then be read in chunks from the stream. This method is particularly suitable for retrieving largeLONGVARBINARYvalues.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
getgetXXXmethod implicitly closes the stream. Also a stream may return0when the methodInputStream.availableis called whether there is data available or not. @param columnIndex the first column is 1 the second is 2 ... @return a Java input stream that delivers the database column value as a stream of uninterpreted bytes. If; if the value is SQLNULLthethenresultvalue returned isnull@exception SQLException if a database access error occurs.
Class ResultSet, Blob getBlob(int)JDBCReturns2.0theGets a BLOBvalue of thevaluedesignated column in the current row of thisResultSetobject as aBlobobject in the Java programming language. @param colName the name of the column from which to retrieve the value @return aBlobobject representing the SQLBLOBvalue in the specified column @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, boolean getBoolean(String)JDBCReturns2.0theGets a BLOBvalue of thevaluedesignated column in the current row of thisResultSetobject as aBlobobject in the Java programming language. @param i the first column is 1 the second is 2 ... @return aBlobobject representing the SQLBLOBvalue in the specified column @since 1.2 @see What Is in the JDBC 2.0 API
Gets the value ofClass ResultSet, boolean getBoolean(int)athe designated column in the current row of thisResultSetobject as abooleanin the Javabooleanprogramming language. @param columnName the SQL name of the column @return the column value; if the value is SQLNULLtheresultvalue returned isfalse@exception SQLException if a database access error occurs
Gets the value ofClass ResultSet, byte getByte(String)athe designated column in the current row of thisResultSetobject as abooleanin the Javabooleanprogramming language. @param columnIndex the first column is 1 the second is 2 ... @return the column value; if the value is SQLNULLtheresultvalue returned isfalse@exception SQLException if a database access error occurs
Gets the value ofClass ResultSet, byte getByte(int)athe designated column in the current row of thisResultSetobject as abytein the Javabyteprogramming language. @param columnName the SQL name of the column @return the column value; if the value is SQLNULLtheresultvalue returned is0@exception SQLException if a database access error occurs
Gets the value ofClass ResultSet, byte[] getBytes(String)athe designated column in the current row of thisResultSetobject as abytein the Javabyteprogramming language. @param columnIndex the first column is 1 the second is 2 ... @return the column value; if the value is SQLNULLtheresultvalue returned is0@exception SQLException if a database access error occurs
Gets the value ofClass ResultSet, byte[] getBytes(int)athe designated column in the current row of thisResultSetobject as aJavabytearray in the Java programming language. The bytes represent the raw values returned by the driver. @param columnName the SQL name of the column @return the column value; if the value is SQLNULLtheresultvalue returned isnull@exception SQLException if a database access error occurs
Gets the value ofClass ResultSet, Reader getCharacterStream(String)athe designated column in the current row of thisResultSetobject as aJavabytearray in the Java programming language. The bytes represent the raw values returned by the driver. @param columnIndex the first column is 1 the second is 2 ... @return the column value; if the value is SQLNULLtheresultvalue returned isnull@exception SQLException if a database access error occurs
Class ResultSet, Reader getCharacterStream(int)JDBC 2.0Gets the value ofathe designated column in the current row of thisResultSetobject as ajava.io.Readerobject. @return ajava.io.Readerobject that contains the column value; if the value is SQLNULLthe value returned isnullin the Java programming language. @param columnName the name of the column @return the value in the specified column as ajava.io.Reader@since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, Clob getClob(String)JDBC 2.0Gets the value ofathe designated column in the current row of thisResultSetobject as ajava.io.Readerobject. @return ajava.io.Readerobject that contains the column value; if the value is SQLNULLthe value returned isnullin the Java programming language. @param columnIndex the first column is 1 the second is 2 ... @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, Clob getClob(int)JDBCReturns2.0theGets a CLOBvalue of thevaluedesignated column in the current row of thisResultSetobject as aClobobject in the Java programming language. @param colName the name of the column from which to retrieve the value @return aClobobject representing the SQLCLOBvalue in the specified column @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, int getConcurrency()JDBCReturns2.0theGets a CLOBvalue of thevaluedesignated column in the current row of thisResultSetobject as aClobobject in the Java programming language. @param i the first column is 1 the second is 2 ... @return aClobobject representing the SQLCLOBvalue in the specified column @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, String getCursorName()JDBC 2.0Returns the concurrency mode of thisresultResultSetsetobject. The concurrency used is determined by thestatementStatementobject that created the result set. @return the concurrency type eitherCONCUR_READ_ONLY orCONCUR_UPDATABLE@exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Gets the name of the SQL cursor used by thisClass ResultSet, Date getDate(String)ResultSetobject.In SQL a result table is retrieved through a cursor that is named. The current row of a result set can be updated or deleted using a positioned update/delete statement that references the cursor name. To insure that the cursor has the proper isolation level to support update the cursor's
selectstatement should be of the form 'select for update'. If the 'for update' clause is omitted the positioned updates may fail.The JDBC API supports this SQL feature by providing the name of the SQL cursor used by a
ResultSetobject. The current row of aResultSetobject is also the current row of this SQL cursor.Note: If positioned update is not supported a
SQLExceptionis thrown. @return the SQL name for thisResultSet object'sSQLcursorname@exception SQLException if a database access error occurs
Gets the value ofClass ResultSet, Date getDate(String, Calendar)athe designated column in the current row of thisResultSetobject as ajava.sql.Dateobject in the Java programming language. @param columnName the SQL name of the column @return the column value; if the value is SQLNULLtheresultvalue returned isnull@exception SQLException if a database access error occurs
Class ResultSet, Date getDate(int)GetsReturns the value ofathe designated column in the current row of thisResultSetobject as ajava.sql.Dateobject in the Java programming language. This method uses the given calendar to construct an appropriate millisecond value for theDatedate if the underlying database does not store timezone information. @param columnName the SQL name of the column from which to retrieve the value @param cal thecalendarjava.util.Calendarobject to use in constructing the date @return the column value as ajava.sql.Dateobject; if the value is SQLNULLtheresultvalue returned isnullin the Java programming language @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Gets the value ofClass ResultSet, Date getDate(int, Calendar)athe designated column in the current row of thisResultSetobject as ajava.sql.Dateobject in the Java programming language. @param columnIndex the first column is 1 the second is 2 ... @return the column value; if the value is SQLNULLtheresultvalue returned isnull@exception SQLException if a database access error occurs
Class ResultSet, double getDouble(String)JDBC 2.0ReturnsGetsthe value ofathe designated column in the current row of thisResultSetobject as ajava.sql.Dateobject in the Java programming language. This method uses the given calendar to construct an appropriate millisecond value for theDatedate if the underlying database does not store timezone information. @param columnIndex the first column is 1 the second is 2 ... @param cal thecalendarjava.util.Calendarobject to use in constructing the date @return the column value as ajava.sql.Dateobject; if the value is SQLNULLtheresultvalue returned isnullin the Java programming language @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Gets the value ofClass ResultSet, double getDouble(int)athe designated column in the current row of thisResultSetobject as adoublein the Javadoubleprogramming language. @param columnName the SQL name of the column @return the column value; if the value is SQLNULLtheresultvalue returned is0@exception SQLException if a database access error occurs
Gets the value ofClass ResultSet, int getFetchDirection()athe designated column in the current row of thisResultSetobject as adoublein the Javadoubleprogramming language. @param columnIndex the first column is 1 the second is 2 ... @return the column value; if the value is SQLNULLtheresultvalue returned is0@exception SQLException if a database access error occurs
Class ResultSet, int getFetchSize()JDBC 2.0Returns the fetch direction for thisresultResultSetsetobject. @return the current fetch direction for thisresultResultSetsetobject @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, float getFloat(String)JDBC 2.0Returns the fetch size for thisresultResultSetsetobject. @return the current fetch size for thisresultResultSetsetobject @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Gets the value ofClass ResultSet, float getFloat(int)athe designated column in the current row of thisResultSetobject as afloatin the Javafloatprogramming language. @param columnName the SQL name of the column @return the column value; if the value is SQLNULLtheresultvalue returned is0@exception SQLException if a database access error occurs
Gets the value ofClass ResultSet, int getInt(String)athe designated column in the current row of thisResultSetobject as afloatin the Javafloatprogramming language. @param columnIndex the first column is 1 the second is 2 ... @return the column value; if the value is SQLNULLtheresultvalue returned is0@exception SQLException if a database access error occurs
Gets the value ofClass ResultSet, int getInt(int)athe designated column in the current row of thisResultSetobject asaanintin the Javaintprogramming language. @param columnName the SQL name of the column @return the column value; if the value is SQLNULLtheresultvalue returned is0@exception SQLException if a database access error occurs
Gets the value ofClass ResultSet, long getLong(String)athe designated column in the current row of thisResultSetobject asaanintin the Javaintprogramming language. @param columnIndex the first column is 1 the second is 2 ... @return the column value; if the value is SQLNULLtheresultvalue returned is0@exception SQLException if a database access error occurs
Gets the value ofClass ResultSet, long getLong(int)athe designated column in the current row of thisResultSetobject as alongin the Javalongprogramming language. @param columnName the SQL name of the column @return the column value; if the value is SQLNULLtheresultvalue returned is0@exception SQLException if a database access error occurs
Gets the value ofClass ResultSet, ResultSetMetaData getMetaData()athe designated column in the current row of thisResultSetobject as alongin the Javalongprogramming language. @param columnIndex the first column is 1 the second is 2 ... @return the column value; if the value is SQLNULLtheresultvalue returned is0@exception SQLException if a database access error occurs
Retrieves the number types and properties ofClass ResultSet, Object getObject(String)athisResultSetobject's columns. @return the description ofathisResultSetobject's columns @exception SQLException if a database access error occurs
Class ResultSet, Object getObject(String, Map)Gets the value of
athe designated column in the current row of thisResultSetobject asaanObjectin the Javaobjectprogramming language.This method will return the value of the given column as a Java object. The type of the Java object will be the default Java object type corresponding to the column's SQL type following the mapping for built-in types specified in the JDBC
specspecification.This method may also be used to read datatabase-specific abstract data types.
JDBC 2.0In the JDBC 2.0 API the behavior of the methodgetObjectis extended to materialize data of SQL user-defined types. Whenthea column contains a structured or distinct value the behavior of this method is as if it were a call to:getObject(columnIndex this.getStatement().getConnection().getTypeMap()). @param columnName the SQL name of the column @return ajava.lang.Objectholding the column value.@exception SQLException if a database access error occurs
Class ResultSet, Object getObject(int)JDBC 2.0Returns the valueinof thespecifieddesignated column in the current row of thisResultSetobject asaanObjectin the Javaobjectprogramming language. This method uses the specifiedMapobject for custom mapping if appropriate. @param colName the name of the column from which to retrieve the value @param map ajava.util.Mapobject that contains the mapping from SQL type names to classes in the Javaclassesprogramming language @return anobjectObjectrepresenting the SQL value in the specified column @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, Object getObject(int, Map)Gets the value of
athe designated column in the current row of thisResultSetobject asaanObjectin the Javaobjectprogramming language.This method will return the value of the given column as a Java object. The type of the Java object will be the default Java object type corresponding to the column's SQL type following the mapping for built-in types specified in the JDBC
specspecification.This method may also be used to read datatabase-specific abstract data types.
JDBC 2.0In the JDBC 2.0 API the behavior of methodgetObjectis extended to materialize data of SQL user-defined types. Whenthea column contains a structured or distinct value the behavior of this method is as if it were a call to:getObject(columnIndex this.getStatement().getConnection().getTypeMap()). @param columnIndex the first column is 1 the second is 2 ... @return ajava.lang.Objectholding the column value @exception SQLException if a database access error occurs
Class ResultSet, Ref getRef(String)JDBC 2.0Returns the value ofathe designated column in the current row of thisResultSetobject asaanObjectin the Javaobjectprogramming language. This method uses the givenMapobject for the custom mapping of the SQL structured or distinct type that is being retrieved. @param i the first column is 1 the second is 2 ... @param map ajava.util.Mapobject that contains the mapping from SQL type names to classes in the Javaclassesprogramming language @return anobjectObjectin the Java programming language representing the SQL value @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, Ref getRef(int)JDBCReturns2.0theGets avalue ofREF(<structured-type>)thecolumn value fromdesignated column in the current row of thisResultSetobject as aRefobject in the Java programming language. @param colName the column name @return aRefobject representing the SQLREFvalue in the specified column @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, int getRow()JDBCReturns2.0theGets avalue ofREF(<structured-type>)thecolumn value fromdesignated column in the current row of thisResultSetobject as aRefobject in the Java programming language. @param i the first column is 1 the second is 2 ... @return aRefobject representing an SQLREFvalue @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, short getShort(String)JDBC 2.0Retrieves the current row number. The first row is number 1 the second number 2 and so on. @return the current row number;0if there is no current row @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Gets the value ofClass ResultSet, short getShort(int)athe designated column in the current row of thisResultSetobject as ashortin the Javashortprogramming language. @param columnName the SQL name of the column @return the column value; if the value is SQLNULLtheresultvalue returned is0@exception SQLException if a database access error occurs
Gets the value ofClass ResultSet, Statement getStatement()athe designated column in the current row of thisResultSetobject as ashortin the Javashortprogramming language. @param columnIndex the first column is 1 the second is 2 ... @return the column value; if the value is SQLNULLtheresultvalue returned is0@exception SQLException if a database access error occurs
Class ResultSet, String getString(String)JDBC 2.0Returns theStatementobject that produced thisResultSetobject. If the result set was generated some other way such as by aDatabaseMetaDatamethod this method returnsnull. @return theStatmentobject that producedthethisresultResultSetsetobject ornullif the result set was produced some other way @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Gets the value ofClass ResultSet, String getString(int)athe designated column in the current row of thisResultSetobject as aStringin the JavaStringprogramming language. @param columnName the SQL name of the column @return the column value; if the value is SQLNULLtheresultvalue returned isnull@exception SQLException if a database access error occurs
Gets the value ofClass ResultSet, Time getTime(String)athe designated column in the current row of thisResultSetobject as aStringin the JavaStringprogramming language. @param columnIndex the first column is 1 the second is 2 ... @return the column value; if the value is SQLNULLtheresultvalue returned isnull@exception SQLException if a database access error occurs
Gets the value ofClass ResultSet, Time getTime(String, Calendar)athe designated column in the current row of thisResultSetobject as ajava.sql.Timeobject in the Java programming language. @param columnName the SQL name of the column @return the column value; if the value is SQLNULLtheresultvalue returned isnull@exception SQLException if a database access error occurs
Class ResultSet, Time getTime(int)GetsReturns the value ofathe designated column in the current row of thisResultSetobject as ajava.sql.Timeobject in the Java programming language. This method uses the given calendar to construct an appropriate millisecond value for theTimetime if the underlying database does not store timezone information. @param columnName the SQL name of the column @param cal thejava.util.Calendarobject to use in constructing the time @param cal the calendar to use in constructing the time @return the column value as ajava.sql.Timeobject; if the value is SQLNULLtheresultvalue returned isnullin the Java programming language @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Gets the value ofClass ResultSet, Time getTime(int, Calendar)athe designated column in the current row of thisResultSetobject as ajava.sql.Timeobject in the Java programming language. @param columnIndex the first column is 1 the second is 2 ... @return the column value; if the value is SQLNULLtheresultvalue returned isnull@exception SQLException if a database access error occurs
Class ResultSet, Timestamp getTimestamp(String)GetsReturns the value ofathe designated column in the current row of thisResultSetobject as ajava.sql.Timeobject in the Java programming language. This method uses the given calendar to construct an appropriate millisecond value for theTimetime if the underlying database does not store timezone information. @param columnIndex the first column is 1 the second is 2 ... @param cal thecalendarjava.util.Calendarobject to use in constructing the time @return the column value as ajava.sql.Timeobject; if the value is SQLNULLtheresultvalue returned isnullin the Java programming language @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Gets the value ofClass ResultSet, Timestamp getTimestamp(String, Calendar)athe designated column in the current row of thisResultSetobject as ajava.sql.Timestampobject. @param columnName the SQL name of the column @return the column value; if the value is SQLNULLtheresultvalue returned isnull@exception SQLException if a database access error occurs
Class ResultSet, Timestamp getTimestamp(int)GetsReturns the value ofathe designated column in the current row of thisResultSetobject as ajava.sql.Timestampobject in the Java programming language. This method uses the given calendar to construct an appropriate millisecond value for theTimestamptimestamp if the underlying database does not store timezone information. @param columnName the SQL name of the column @param cal thecalendarjava.util.Calendarobject to use in constructing thetimestampdate @return the column value as ajava.sql.Timestampobject; if the value is SQLNULLtheresultvalue returned isnullin the Java programming language @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Gets the value ofClass ResultSet, Timestamp getTimestamp(int, Calendar)athe designated column in the current row of thisResultSetobject as ajava.sql.Timestampobject in the Java programming language. @param columnIndex the first column is 1 the second is 2 ... @return the column value; if the value is SQLNULLtheresultvalue returned isnull@exception SQLException if a database access error occurs
Class ResultSet, int getType()GetsReturns the value ofathe designated column in the current row of thisResultSetobject as ajava.sql.Timestampobject in the Java programming language. This method uses the given calendar to construct an appropriate millisecond value for theTimestamptimestamp if the underlying database does not store timezone information. @param columnIndex the first column is 1 the second is 2 ... @param cal thecalendarjava.util.Calendarobject to use in constructing the timestamp @return the column value as ajava.sql.Timestampobject; if the value is SQLNULLtheresultvalue returned isnullin the Java programming language @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, InputStream getUnicodeStream(String)JDBC 2.0Returns the type of thisresultResultSetsetobject. The type is determined by thestatementStatementobject that created the result set. @returnTYPE_FORWARD_ONLYTYPE_SCROLL_INSENSITIVEorTYPE_SCROLL_SENSITIVE@exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Gets the value ofClass ResultSet, InputStream getUnicodeStream(int)athe designated column in the current row of thisResultSetobject as a stream of Unicode characters. The value can then be read in chunks from the stream. This method is particularly suitable for retrieving largeLONGVARCHARvalues. The JDBC driver will do any necessary conversion from the database format into Unicode. The byte format of the Unicode stream must be Java UTF-8 as defined in the JavaVirtual Machine Specificationvirtual machine specification.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
getgetXXXmethod implicitly closes the stream. Also a stream may return0when the methodavailableis called whether there is data available or not. @param columnName the SQL name of the column @return a Java input stream that delivers the database column value as a stream of two-byte Unicode characters. If the value is SQLNULLthethenresultvalue returned isnull. @exception SQLException if a database access error occurs @deprecated
Gets the value of a column in the current row as a stream of Gets the value of the designated column in the current row of thisClass ResultSet, SQLWarning getWarnings()ResultSetobject as as a stream of Unicode characters. The value can then be read in chunks from the stream. This method is particularly suitable for retrieving largeLONGVARCHARvalues. The JDBC driver will do any necessary conversion from the database format into Unicode. The byte format of the Unicode stream must be Java UTF-8 as specified in the JavaVirtual Machine Specificationvirtual machine specification.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
getgetXXXmethod implicitly closes the stream. Also a stream may return0when the methodInputStream.availableis called whether there is data available or not. @param columnIndex the first column is 1 the second is 2 ... @return a Java input stream that delivers the database column value as a streamofin JavatwoUTF-byte8Unicodebytecharacters.format;Ifif the value is SQLNULLthethenresultvalue returned isnull@exception SQLException if a database access error occurs @deprecated use.getCharacterStreamin place ofgetUnicodeStream
Class ResultSet, void insertRow()TheReturns the first warning reported by calls on thisResultSetisreturnedobject. Subsequent warnings on thisResultSetwarningsobject will be chained tothistheSQLWarningobject that this method returns.The warning chain is automatically cleared each time a new row is read.
Note: This warning chain only covers warnings caused by
ResultSetmethods. Any warning caused bystatementStatementmethods (such as reading OUT parameters) will be chained on theStatementobject. @return the firstSQLWarningobject reported ornull@exception SQLException if a database access error occurs
Class ResultSet, boolean isAfterLast()JDBC 2.0Inserts the contents of the insert row intothethisresultResultSetsetobjaect and into the database.MustThe cursor must be on the insert row when this method is called. @exception SQLException if a database access error occurs if this method is called when the cursor is not on the insert row or if not all of non-nullable columns in the insert row have been given a value @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, boolean isBeforeFirst()JDBC 2.0Indicates whether the cursor is after the last row inthethisresultResultSetsetobject. @returntrueif the cursor is after the last row;falseotherwise.ifReturnsthefalsecursor iswhenat any other position or the result set contains no rows.@exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, boolean isFirst()JDBC 2.0Indicates whether the cursor is before the first row inthethisresultResultSetsetobject. @returntrueif the cursor is before the first row;falseotherwise.ifReturnsthefalsecursor iswhenat any other position or the result set contains no rows.@exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, boolean isLast()JDBC 2.0Indicates whether the cursor is on the first row ofthethisresultResultSetsetobject. @returntrueif the cursor is on the first row;falseotherwise.@exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, boolean last()JDBC 2.0Indicates whether the cursor is on the last row ofthethisresultResultSetsetobject. Note: Calling the methodisLastmay be expensive because the JDBC driver might need to fetch ahead one row in order to determine whether the current row is the last row in the result set. @returntrueif the cursor is on the last row;falseotherwise.@exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void moveToCurrentRow()JDBC 2.0Moves the cursor to the last row inthethisresultResultSetsetobject. @returntrueif the cursor is on a valid row;falseif there are no rows in the result set @exception SQLException if a database access error occurs or the result set type isTYPE_FORWARD_ONLY@since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void moveToInsertRow()JDBC 2.0Moves the cursor to the remembered cursor position usually the current row. This method has no effect if the cursor is not on the insert row. @exception SQLException if a database access error occurs or the result set is not updatable @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, boolean next()JDBC 2.0Moves the cursor to the insert row. The current cursor position is remembered while the cursor is positioned on the insert row. The insert row is a special row associated with an updatable result set. It is essentially a buffer where a new row may be constructed by calling theupdateXXXmethods prior to inserting the row into the result set. Only theupdateXXXgetXXXandinsertRowmethods may be called when the cursor is on the insert row. All of the columns in a result set must be given a value each time this method is called before callinginsertRow.The methodAnupdateXXXmethod must be called before agetXXXmethod can be called on a column value. @exception SQLException if a database access error occurs or the result set is not updatable @since 1.2 @see What Is in the JDBC 2.0 API
Moves the cursor down one row from its current position. AClass ResultSet, boolean previous()ResultSetcursor is initially positioned before the first row; the first call to the methodnext makes the first row the current row; the second call makes the second row the current row and so on.If an input stream is open for the current row a call to the method
nextwill implicitly close it.TheAResultSetobject's warning chain is cleared when a new row is read. @returntrueif the new current row is valid;falseif there are no more rows @exception SQLException if a database access error occurs
Class ResultSet, void refreshRow()JDBC 2.0Moves the cursor to the previous row inthethisresultResultSetsetobject.Note: Calling the method
previous()is not the same as calling the methodrelative(-1)because it makes sense to callprevious() when there is no current row. @returntrueif the cursor is on a valid row;falseif it is off the result set @exception SQLException if a database access error occurs or the result set type isTYPE_FORWARD_ONLY@since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, boolean relative(int)JDBC 2.0Refreshes the current row with its most recent value in the database.CannotThis method cannot be called when the cursor is on the insert row.The
refreshRowmethod provides a way for an application to explicitly tell the JDBC driver to refetch a row(s) from the database. An application may want to callrefreshRowwhen caching or prefetching is being done by the JDBC driver to fetch the latest value of a row from the database. The JDBC driver may actually refresh multiple rows at once if the fetch size is greater than one.All values are refetched subject to the transaction isolation level and cursor sensitivity. If
refreshRowis called after calling anupdateXXXmethod but before calling the methodupdateRowthen the updates made to the row are lost. Calling the methodrefreshRowfrequently will likely slow performance. @exception SQLException if a database access error occurs or if this method is called when the cursor is on the insert row @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, boolean rowDeleted()JDBC 2.0Moves the cursor a relative number of rows either positive or negative. Attempting to move beyond the first/last row in the result set positions the cursor before/after the the first/last row. Callingrelative(0)is valid but does not change the cursor position.Note: Calling the method
relative(1)is different from calling the methodnext()because is makes sense to callnext()when there is no current row for example when the cursor is positioned before the first row or after the last row of the result set. @returntrueif the cursor is on a row;falseotherwise @exception SQLException if a database access error occurs there is no current row or the result set type isTYPE_FORWARD_ONLY@since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, boolean rowInserted()JDBC 2.0Indicates whether a row has been deleted. A deleted row may leave a visible "hole" in a result set. This method can be used to detect holes in a result set. The value returned depends on whether or notthethisresultResultSetsetobject can detect deletions. @returntrueif a row was deleted and deletions are detected;falseotherwise @exception SQLException if a database access error occurs @see DatabaseMetaData#deletesAreDetected @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, boolean rowUpdated()JDBC 2.0Indicates whether the current row has had an insertion. The value returned depends on whether or notthethisresultResultSetsetobject can detect visible inserts. @returntrueif a row has had an insertion and insertions are detected;falseotherwise @exception SQLException if a database access error occurs @see DatabaseMetaData#insertsAreDetected @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void setFetchDirection(int)JDBC 2.0Indicates whether the current row has been updated. The value returned depends on whether or not the result set can detect updates. @returntrueif the row has been visibly updated by the owner or another and updates are detected @exception SQLException if a database access error occurs @see DatabaseMetaData#updatesAreDetected @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void setFetchSize(int)JDBC 2.0Gives a hint as to the direction in which the rows in thisresultResultSetsetobject will be processed. The initial value is determined by thestatementStatementobject that producedthethisresultResultSetsetobject. The fetch direction may be changed at any time. @exception SQLException if a database access error occurs or the result set type isTYPE_FORWARD_ONLYand the fetch direction is notFETCH_FORWARD@since 1.2 @see What Is in the JDBC 2.0 API @see Statement#setFetchDirection
Class ResultSet, void updateAsciiStream(String, InputStream, int)JDBC 2.0Gives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed for thisresultResultSetsetobject. If the fetch size specified is zero 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 thestatementStatementobject that created the result set. The fetch size may be changed at any time. @param rows the number of rows to fetch @exception SQLException if a database access error occurs or the condition0 < rows < this.getMaxRows()is not satisfied @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateAsciiStream(int, InputStream, int)JDBC 2.0Updatesathe designated column with an ascii stream value. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnName the name of the column @param x the new column value @param length the length of the stream @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateBigDecimal(String, BigDecimal)JDBC 2.0Updatesathe designated column with an ascii stream value. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnIndex the first column is 1 the second is 2 ... @param x the new column value @param length the length of the stream @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateBigDecimal(int, BigDecimal)JDBC 2.0Updatesathe designated column with ajava.sql.BigDecimalvalue. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnName the name of the column @param x the new column value @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateBinaryStream(String, InputStream, int)JDBC 2.0Updatesathe designated column with ajava.math.BigDecimalvalue. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnIndex the first column is 1 the second is 2 ... @param x the new column value @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateBinaryStream(int, InputStream, int)JDBC 2.0Updatesathe designated column with a binary stream value. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnName the name of the column @param x the new column value @param length the length of the stream @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateBoolean(String, boolean)JDBC 2.0Updatesathe designated column with a binary stream value. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnIndex the first column is 1 the second is 2 ... @param x the new column value @param length the length of the stream @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateBoolean(int, boolean)JDBC 2.0Updatesathe designated column with abooleanvalue. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnName the name of the column @param x the new column value @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateByte(String, byte)JDBC 2.0Updatesathe designated column with abooleanvalue. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnIndex the first column is 1 the second is 2 ... @param x the new column value @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateByte(int, byte)JDBC 2.0Updatesathe designated column with abytevalue. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnName the name of the column @param x the new column value @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateBytes(String, byte[])JDBC 2.0Updatesathe designated column with abytevalue. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnIndex the first column is 1 the second is 2 ... @param x the new column value @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Updates the designated column with aClass ResultSet, void updateBytes(int, byte[])booleanvalue. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. JDBC 2.0 Updates a column with a byte array value. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnName the name of the column @param x the new column value @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateCharacterStream(String, Reader, int)JDBC 2.0Updatesathe designated column with abytearray value. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnIndex the first column is 1 the second is 2 ... @param x the new column value @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateCharacterStream(int, Reader, int)JDBC 2.0Updatesathe designated column with a character stream value. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnName the name of the column @param x the new column value @param length the length of the stream @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateDate(String, Date)JDBC 2.0Updatesathe designated column with a character stream value. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnIndex the first column is 1 the second is 2 ... @param x the new column value @param length the length of the stream @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateDate(int, Date)JDBC 2.0Updatesathe designated column with ajava.sql.Datevalue. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnName the name of the column @param x the new column value @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateDouble(String, double)JDBC 2.0Updatesathe designated column with ajava.sql.Datevalue. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnIndex the first column is 1 the second is 2 ... @param x the new column value @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateDouble(int, double)JDBC 2.0Updatesathe designated column with adoublevalue. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnName the name of the column @param x the new column value @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateFloat(String, float)JDBC 2.0Updatesathe designated column with aDoubledoublevalue. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnIndex the first column is 1 the second is 2 ... @param x the new column value @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateFloat(int, float)JDBC 2.0Updatesathe designated column with afloatvalue. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnName the name of the column @param x the new column value @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateInt(String, int)JDBC 2.0Updatesathe designated column with afloatvalue. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnIndex the first column is 1 the second is 2 ... @param x the new column value @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateInt(int, int)JDBC 2.0Updatesathe designated column with anintegerintvalue. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnName the name of the column @param x the new column value @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateLong(String, long)JDBC 2.0Updatesathe designated column with anintegerintvalue. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnIndex the first column is 1 the second is 2 ... @param x the new column value @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateLong(int, long)JDBC 2.0Updatesathe designated column with alongvalue. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnName the name of the column @param x the new column value @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateNull(String)JDBC 2.0Updatesathe designated column with alongvalue. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnIndex the first column is 1 the second is 2 ... @param x the new column value @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateNull(int)JDBC 2.0Updatesathe designated column with anullvalue. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnName the name of the column @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateObject(String, Object)JDBC 2.0 GiveGives a nullable column a null value. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnIndex the first column is 1 the second is 2 ... @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateObject(String, Object, int)JDBC 2.0Updatesathe designated column with anObjectvalue. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnName the name of the column @param x the new column value @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateObject(int, Object)JDBC 2.0Updatesathe designated column with anObjectvalue. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnName the name of the column @param x the new column value @param scaleForforjava.sql.Types.orDECIMALDECIMAjava.sql.Types.NUMERICtypes this is the number of digits after the decimal point. For all other types this value will be ignored. @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateObject(int, Object, int)JDBC 2.0Updatesathe designated column with anObjectvalue. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnIndex the first column is 1 the second is 2 ... @param x the new column value @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateRow()JDBC 2.0Updatesathe designated column with anObjectvalue. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnIndex the first column is 1 the second is 2 ... @param x the new column value @param scaleForforjava.sql.Types.orDECIMALDECIMAjava.sql.Types.NUMERICtypes this is the number of digits after the decimal point. For all other types this value will be ignored. @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateShort(String, short)JDBC 2.0Updates the underlying database with the new contents of the current row of thisResultSetobject.CannotThis method cannot be called when the cursor is on the insert row. @exception SQLException if a database access error occurs or if this method is called when the cursor is on the insert row @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateShort(int, short)JDBC 2.0Updatesathe designated column with ashortvalue. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnName the name of the column @param x the new column value @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateString(String, String)JDBC 2.0Updatesathe designated column with ashortvalue. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnIndex the first column is 1 the second is 2 ... @param x the new column value @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateString(int, String)JDBC 2.0Updatesathe designated column with aStringvalue. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnName the name of the column @param x the new column value @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateTime(String, Time)JDBC 2.0Updatesathe designated column with aStringvalue. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnIndex the first column is 1 the second is 2 ... @param x the new column value @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateTime(int, Time)JDBC 2.0Updatesathe designated column with ajava.sql.Timevalue. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnName the name of the column @param x the new column value @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateTimestamp(String, Timestamp)JDBC 2.0Updatesathe designated column with ajava.sql.Timevalue. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnIndex the first column is 1 the second is 2 ... @param x the new column value @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, void updateTimestamp(int, Timestamp)JDBC 2.0Updatesathe designated column with ajava.sql.Timestampvalue. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnName the name of the column @param x the new column value @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, boolean wasNull()JDBC 2.0Updatesathe designated column with ajava.sql.Timestampvalue. TheupdateXXXmethods are used to update column values in the current row or the insert row. TheupdateXXXmethods do not update the underlying database; instead theupdateRoworinsertRowmethods are called to update the database. @param columnIndex the first column is 1 the second is 2 ... @param x the new column value @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Reports whether the last column read had a value of SQLClass ResultSet, int CONCUR_READ_ONLYNULL. Note that you must first call one of thegetXXX methods on a column to try to read its value and then call the methodwasNull()to see if the value read was SQLNULL. @returntrueif the last column value read was SQLNULLandfalseotherwise @exception SQLException if a database access error occurs
Class ResultSet, int CONCUR_UPDATABLEJDBCThe2.0constantTheindicating the concurrency mode for aResultSetobject that may NOT be updated. @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, int FETCH_FORWARDJDBCThe2.0constantTheindicating the concurrency mode for aResultSetobject that may be updated. @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, int FETCH_REVERSEJDBCThe2.0constantTheindicating that the rows in a result set will be processed in a forward direction; first-to-last. This constant is used by the methodsetFetchDirectionas a hint to the driver which the driver may ignore. @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, int FETCH_UNKNOWNJDBCThe2.0constantTheindicating that the rows in a result set will be processed in a reverse direction; last-to-first. This constant is used by the methodsetFetchDirectionas a hint to the driver which the driver may ignore. @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, int TYPE_FORWARD_ONLYJDBCThe2.0constantTheindicating that the order in which rows in a result set will be processed is unknown. This constant is used by the methodsetFetchDirectionas a hint to the driver which the driver may ignore.
Class ResultSet, int TYPE_SCROLL_INSENSITIVEJDBCThe2.0constantTheindicating the type for aResultSetobject whose cursor may move only forward. @since 1.2 @see What Is in the JDBC 2.0 API
Class ResultSet, int TYPE_SCROLL_SENSITIVEJDBCThe2.0constantTheindicating the type for aResultSetobject that is scrollable but generally not sensitive to changes made by others. @since 1.2 @see What Is in the JDBC 2.0 API
JDBCThe2.0constantTheindicating the type for aResultSetobject that is scrollable and generally sensitive to changes made by others. @since 1.2 @see What Is in the JDBC 2.0 API
An object that can be used toClass ResultSetMetaData, String getCatalogName(int)find outget information about the types and properties of the columns in aResultSetobject. The following code fragment creates theResultSetobject rs creates theResultSetMetaDataobject rsmd and uses rsmd to find out how many columns rs has and whether the first column in rs can be used in aWHEREclause.ResultSet rs = stmt.executeQuery("SELECT a b c FROM TABLE2"); ResultSetMetaData rsmd = rs.getMetaData(); int numberOfColumns = rsmd.getColumnCount(); boolean b = rsmd.isSearchable(1);
GetsClass ResultSetMetaData, String getColumnClassName(int)athe designated column's table's catalog name. @param column the first column is 1 the second is 2 ... @return column name or "" if not applicable.@exception SQLException if a database access error occurs
Class ResultSetMetaData, int getColumnCount()JDBC 2.0Returns the fully-qualified name of the Java class whose instances are manufactured if the method
ResultSet.getObjectis called to retrieve a value from the column.ResultSet.getObjectmay return a subclass of the class returned by this method. @return the fully-qualified name of the class in the Java programming language that would be used by the methodResultSet.getObjectto retrieve the value in the specified column. This is the class name used for custom mapping. @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Returns the number of columns in this ResultSet object. @return the number of columns @exception SQLException if a database access error occurs
Class ResultSetMetaData, int getColumnDisplaySize(int)Indicates the designated column's normalClass ResultSetMetaData, String getColumnLabel(int)maxmaximum width incharscharacters. @param column the first column is 1 the second is 2 ... @return the normal maximum number of characters allowed as the width of the designated column @exception SQLException if a database access error occurs
Gets theClass ResultSetMetaData, String getColumnName(int)suggesteddesignated column's suggested title for use in printouts and displays. @param column the first column is 1 the second is 2 ... @return the suggested column title @exception SQLException if a database access error occurs
Class ResultSetMetaData, int getColumnType(int)GetsGetathe designated column's name. @param column the first column is 1 the second is 2 ... @return column name @exception SQLException if a database access error occurs
RetrievesClass ResultSetMetaData, String getColumnTypeName(int)athe designated column's SQL type. @param column the first column is 1 the second is 2 ... @return SQL type from java.sql.Types @exception SQLException if a database access error occurs @see Types
RetrievesClass ResultSetMetaData, int getPrecision(int)athe designated column's database-specific type name. @param column the first column is 1 the second is 2 ... @return type name used by the database. If the column type is a user-defined type then a fully-qualified type name is returned. @exception SQLException if a database access error occurs
Class ResultSetMetaData, int getScale(int)GetsGetathe designated column's number of decimal digits. @param column the first column is 1 the second is 2 ... @return precision @exception SQLException if a database access error occurs
GetsClass ResultSetMetaData, String getSchemaName(int)athe designated column's number of digits to right of the decimal point. @param column the first column is 1 the second is 2 ... @return scale @exception SQLException if a database access error occurs
Class ResultSetMetaData, String getTableName(int)GetsGetathe designated column's table's schema. @param column the first column is 1 the second is 2 ... @return schema name or "" if not applicable @exception SQLException if a database access error occurs
GetsClass ResultSetMetaData, boolean isAutoIncrement(int)athe designated column's table name. @param column the first column is 1 the second is 2 ... @return table name or "" if not applicable @exception SQLException if a database access error occurs
Indicates whether the designated column is automatically numbered thus read-only. @param column the first column is 1 the second is 2 ... @returnClass ResultSetMetaData, boolean isCaseSensitive(int)trueif so;falseotherwise @exception SQLException if a database access error occurs
Indicates whether a column's case matters. @param column the first column is 1 the second is 2 ... @returnClass ResultSetMetaData, boolean isCurrency(int)trueif so;falseotherwise @exception SQLException if a database access error occurs
Indicates whether the designated column is a cash value. @param column the first column is 1 the second is 2 ... @returnClass ResultSetMetaData, boolean isDefinitelyWritable(int)trueif so;falseotherwise @exception SQLException if a database access error occurs
Indicates whether a write on the designated column will definitely succeed. @param column the first column is 1 the second is 2 ... @returnClass ResultSetMetaData, int isNullable(int)trueif so;falseotherwise @exception SQLException if a database access error occurs
Indicates the nullability of values in the designated column. @param column the first column is 1 the second is 2 ... @return the nullability status of the given column; one ofClass ResultSetMetaData, boolean isReadOnly(int)columnNoNullscolumnNullableorcolumnNullableUnknown@exception SQLException if a database access error occurs
Indicates whetherClass ResultSetMetaData, boolean isSearchable(int)athe designated column is definitely not writable. @param column the first column is 1 the second is 2 ... @returntrueif so;falseotherwise @exception SQLException if a database access error occurs
Indicates whether the designated column can be used in a where clause. @param column the first column is 1 the second is 2 ... @returnClass ResultSetMetaData, boolean isSigned(int)trueif so;falseotherwise @exception SQLException if a database access error occurs
Indicates whether values in the designated column are signed numbers. @param column the first column is 1 the second is 2 ... @returnClass ResultSetMetaData, boolean isWritable(int)trueif so;falseotherwise @exception SQLException if a database access error occurs
Indicates whether it is possible for a write on the designated column to succeed. @param column the first column is 1 the second is 2 ... @returnClass ResultSetMetaData, int columnNoNullstrueif so;falseotherwise @exception SQLException if a database access error occurs
Class ResultSetMetaData, int columnNullableColumnThe constant indicating that a column does not allowNULLvalues.
Class ResultSetMetaData, int columnNullableUnknownColumnThe constant indicating that a column allowsNULLvalues.
NullabilityThe constant indicating that the nullability of a column's values is unknown.
Class SQLData, String getSQLTypeName()JDBC 2.0The interface used for the custom mapping of SQL user-defined types. This interface must be implemented byaany Java class that is registered in a type mapping. It is expected that this interface will normally be implemented by a tool. The methods in this interface are called by the driver and are never called by a programmer directly. @since 1.2 @see What Is in the JDBC 2.0 API
Returns the fully-qualified name of the SQL user-defined type that this object represents. This method is called by the JDBC driver to get the name of the UDT instance that is being mapped to this instance ofClass SQLData, void readSQL(SQLInput, String)SQLData. @returnsreturn the type name that was passed to the methodreadSqlwhen this object was constructed and populated @exception SQLException if there is a database access error @since 1.2 @see What Is in the JDBC 2.0 API
Populates this object with data read from the database. The implementation of the method must follow this protocol:Class SQLData, void writeSQL(SQLOutput)It must read each of the attributes or elements of the SQL type from the given input stream. This is done by calling a method of the input stream to read each item in the order that they appear in the SQL definition of the type.
The JDBC driver initializes the input stream with a type map before calling this method which is used by the appropriate- The method
readSQLthen assigns the data to appropriate fields or elements (of this or other objects). Specifically it must call the appropriateSQLInput.readXXXmethod(s) to do the following: for aDistinct Typedistinct type read its single data element; for aStructuredstructuredTypetype read a value for each attribute of the SQL type.SQLInput.readXXXmethod on the stream. @param stream theinputSQLInputSQLobject from which to read the datastreamfor the value that is being custom mapped @paramdescriptortypeName the SQL type name of the value on the data stream @exception SQLException if there is a database access error @see SQLInput
Writes this object to the given SQL data stream converting it back to its SQL value in the data source. The implementation of the method must follow this protocol:
It must write each of the attributes of the SQL type to the given output stream. This is done by calling a method of the output stream to write each item in the order that they appear in the SQL definition of the type. Specifically it must call the appropriateSQLOutput.writeXXXmethod(s) to do the following: for a Distinct Type write its single data element; for a Structured Type write a value for each attribute of the SQL type. @param stream theoutputSQLOutputSQLobject to which to write the datastreamfor the value that was custom mapped @exception SQLException if there is a database access error @see SQLOutput @since 1.2 @see What Is in the JDBC 2.0 API
Class SQLException, constructor SQLException()An exception that provides information on a database access error or other errors.
Each
SQLExceptionprovides several kinds of information:
- a string describing the error. This is used as the Java Exception message available via the method
getMesage.- a "SQLstate" string which follows the XOPEN SQLstate conventions. The values of the SQLState string are described in the XOPEN SQL spec.
- an integer error code that is specific to each vendor. Normally this will be the actual error code returned by the underlying database.
- a chain to a next Exception. This can be used to provide additional error information.
Constructs anClass SQLException, constructor SQLException(String)SQLExceptionobject; reason defaults to null SQLState defaults tonulland vendorCode defaults to 0.
Constructs anClass SQLException, SQLException getNextException()SQLExceptionobject with a reason; SQLState defaults tonulland vendorCode defaults to 0. @param reason a description of the exception
Retrieves the exception chained to thisClass SQLException, void setNextException(SQLException)SQLExceptionobject. @return the nextSQLExceptionobject in the chain;nullif there are none
Adds anSQLExceptionobject to the end of the chain. @param ex the new exception that will be added to the end of theSQLExceptionchain
Class SQLInput, Array readArray()JDBC 2.0 AAn input stream that contains a stream of values representing an instance of an SQL structured or distinct type. This interface used only for custom mapping is used by the driver behind the scenes and a programmer never directly invokesSQLInputmethods. ThereadXXXmethods provide a way to read the values in anSQLInputobject. The methodwasNullis used to determine whether the the last value read was SQLNULL.When the method
getObjectis called with an object of a class implementing the interfaceSQLDatathe JDBC driver calls the methodSQLData.getSQLTypeto determine the SQL type of the user-defined type (UDT) being custom mapped. The driver creates an instance ofSQLInputpopulating it with the attributes of the UDT. The driver then passes the input stream to the methodSQLData.readSQLwhich in turn calls theSQLInput.readXXXmethods in its implementation for reading the attributes from the input stream. @since 1.2 @see What Is in the JDBC 2.0 API
Reads anClass SQLInput, InputStream readAsciiStream()arraySQLARRAYvalue from the stream and returns it as anArrayobject in the Java programming language. @return anArrayobject representing data of the SQLarrayARRAYvalue at the head of the stream;nullif the value read is SQLNULL@exception SQLException if a database access error occurs
Returns the next attribute in the stream as a stream of ASCII characters. @return the attribute; if the value is SQLClass SQLInput, BigDecimal readBigDecimal()NULLreturnreturnsnull@exception SQLException if a database access error occurs.
Reads the next attribute in the stream as aClass SQLInput, InputStream readBinaryStream()java.math.BigDecimalobject in the Java programming language. @return the attribute; if the value is SQLNULLreturnreturnsnull@exception SQLException if a database access error occurs.
Returns the next attribute in the stream as a stream of uninterpreted bytes. @return the attribute; if the value is SQLClass SQLInput, Blob readBlob()NULLreturnreturnsnull@exception SQLException if a database access error occurs.
ReadsClass SQLInput, boolean readBoolean()aan SQLBLOBvalue from the stream and returns it as aBlobobject in the Java programming language. @returnanaBlobobject representing data of the SQLBLOBvalue at the head of the stream;nullif the value read is SQLNULL@exception SQLException if a database access error occurs
Reads the next attribute in the stream as aClass SQLInput, byte readByte()booleanin the Javabooleanprogramming language. @return the attribute; if the value is SQLNULLreturnreturnsnull.false@exception SQLException if a database access error occurs
Reads the next attribute in the stream as aClass SQLInput, byte[] readBytes()bytein the Javabyteprogramming language. @return the attribute; if the value is SQLNULLreturnreturnsnull.0@exception SQLException if a database access error occurs
Reads the next attribute in the stream as an array of bytes in the Java programming language. @return the attribute; if the value is SQLClass SQLInput, Reader readCharacterStream()NULLreturnreturnsnull@exception SQLException if a database access error occurs.
Returns the next attribute in the stream as a stream of Unicode characters. @return the attribute; if the value is SQLClass SQLInput, Clob readClob()NULLreturnreturnsnull@exception SQLException if a database access error occurs.
ReadsClass SQLInput, Date readDate()aan SQLCLOBvalue from the stream and returns it as aClobobject in the Java programming language. @returnanaClobobject representing data of the SQLCLOBvalue at the head of the stream;nullif the value read is SQLNULL@exception SQLException if a database access error occurs
Reads the next attribute in the stream as aClass SQLInput, double readDouble()java.sql.Dateobject. @return the attribute; if the value is SQLNULLreturnreturnsnull@exception SQLException if a database access error occurs.
Reads the next attribute in the stream as aClass SQLInput, float readFloat()doublein the Javadoubleprogramming language. @return the attribute; if the value is SQLNULLreturnreturnsnull.0@exception SQLException if a database access error occurs
Reads the next attribute in the stream as aClass SQLInput, int readInt()floatin the Javafloatprogramming language. @return the attribute; if the value is SQLNULLreturnreturnsnull.0@exception SQLException if a database access error occurs
Reads the next attribute in the stream asClass SQLInput, long readLong()aanintin the Javaintprogramming language. @return the attribute; if the value is SQLNULLreturnreturnsnull.0@exception SQLException if a database access error occurs
Reads the next attribute in the stream as aClass SQLInput, Object readObject()longin the Javalongprogramming language. @return the attribute; if the value is SQLNULLreturnreturnsnull.0@exception SQLException if a database access error occurs
Returns the datum at the head of the stream asClass SQLInput, Ref readRef()aanObjectin the Javaobjectprogramming language. The actual type of the object returned is determined by the default type mapping and any customizations present in this stream's type map.A type map is registered with the stream by the JDBC driver before the stream is passed to the application.
When the datum at the head of the stream is an SQL
NULLthe method returnsnull. If the datum is an SQL structured or distinct type it determines the SQL type of the datum at the head of the stream. If the stream's type map has an entry for that SQL type the driver constructs an object of the appropriate class and calls the methodSQLData.readSQLon that object which reads additional data from the stream using the protocol described for that method. @return the datum at the head of the stream asaanObjectin the Javaobject;programming language;null if the datum is SQLNULL@exception SQLException if a database access error occurs
ReadsClass SQLInput, short readShort()aan SQLREFvalue from the stream and returns it as a(<structured-type>)Refobject in the Java programming language. @returnanaRefobject representingdata ofthe SQLREFvalue at the head of the stream;nullif the value read is SQLNULL@exception SQLException if a database access error occurs
Reads the next attribute in the stream as aClass SQLInput, String readString()shortin the Javashortprogramming language. @return the attribute; if the value is SQLNULLreturnreturnsnull.0@exception SQLException if a database access error occurs
Reads the next attribute in the stream as aClass SQLInput, Time readTime()Stringin the JavaStringprogramming language. @return the attribute; if the value is SQLNULLreturnreturnsnull@exception SQLException if a database access error occurs.
Reads the next attribute in the stream as aClass SQLInput, Timestamp readTimestamp()java.sql.Timeobject. @return the attribute; if the value is SQLNULLreturnreturnsnull@exception SQLException if a database access error occurs.
Reads the next attribute in the stream as aClass SQLInput, boolean wasNull()java.sql.Timestampobject. @return the attribute; if the value is SQLNULLreturnreturnsnull@exception SQLException if a database access error occurs.
Determines whether the last value read wasnullSQLNULL. @returntrueif the most recentlygottenread SQL value wasnullSQLNULL; otherwisefalse@exception SQLException if a database access error occurs
Class SQLOutput, void writeArray(Array)JDBC 2.0The output stream for writing the attributes of a user-defined type back to the database. This interface used only for custom mapping is used by the driver and its methods are never directly invoked by a programmer.When an object of a class implementing the interface
SQLDatais passed as an argument to an SQL statement the JDBC driver calls the methodSQLData.getSQLTypeto determine the kind of SQL datum being passed to the database. The driver then creates an instance ofSQLOutputand passes it to the methodSQLData.writeSQL. The methodwriteSQLin turn calls the appropriateSQLOutput.writeXXXmethods to write data from theSQLDataobject to theSQLOutputoutput stream as the representation of an SQL user-defined type. @since 1.2 @see What Is in the JDBC 2.0 API
Writes anClass SQLOutput, void writeAsciiStream(InputStream)arraySQLARRAYvalue to the stream. @param x anArrayobject representing data of an SQLarrayARRAYtype @exception SQLException if a database access error occurs
Class SQLOutput, void writeBigDecimal(BigDecimal)ReturnsWrites the next attribute to the stream as a stream of ASCII characters. @param x the value to pass to the database.@exception SQLException if a database access error occurs
Writes the next attribute to the stream as a java.math.BigDecimal object. Writes the next attribute to the stream as aClass SQLOutput, void writeBinaryStream(InputStream)Stringin the Java programming language. @param x the value to pass to the database.@exception SQLException if a database access error occurs
Class SQLOutput, void writeBlob(Blob)ReturnsWrites the next attribute to the stream as a stream of uninterpreted bytes. @param x the value to pass to the database.@exception SQLException if a database access error occurs
WritesClass SQLOutput, void writeBoolean(boolean)aan SQLBLOB value to the stream. @param xanaBlobobject representingadata of an SQLBLOBvalue @exception SQLException if a database access error occurs
Writes the next attribute to the stream as a Java boolean. Writes the next attribute to the stream as aClass SQLOutput, void writeByte(byte)Stringin the Java programming language. @param x the value to pass to the database.@exception SQLException if a database access error occurs
Writes the next attribute to the stream as a Java byte. Writes the next attribute to the stream as aClass SQLOutput, void writeBytes(byte[])Stringin the Java programming language. @param x the value to pass to the database.@exception SQLException if a database access error occurs
Writes the next attribute to the stream as an array of bytes. Writes the next attribute to the stream as aClass SQLOutput, void writeCharacterStream(Reader)Stringin the Java programming language. @param x the value to pass to the database.@exception SQLException if a database access error occurs
Class SQLOutput, void writeClob(Clob)ReturnsWrites the next attribute to the stream as a stream of Unicode characters. @param x the value to pass to the database.@exception SQLException if a database access error occurs
WritesClass SQLOutput, void writeDate(Date)aan SQLCLOB value to the stream. @param xanaClobobject representingadata of an SQLCLOBvalue @exception SQLException if a database access error occurs
Writes the next attribute to the stream as a java.sql.Date object. Writes the next attribute to the stream as aClass SQLOutput, void writeDouble(double)java.sql.Dateobject in the Java programming language. @param x the value to pass to the database.@exception SQLException if a database access error occurs
Writes the next attribute to the stream as a Java double. Writes the next attribute to the stream as aClass SQLOutput, void writeFloat(float)Stringin the Java programming language. @param x the value to pass to the database.@exception SQLException if a database access error occurs
Writes the next attribute to the stream as a Java float. Writes the next attribute to the stream as aClass SQLOutput, void writeInt(int)Stringin the Java programming language. @param x the value to pass to the database.@exception SQLException if a database access error occurs
Writes the next attribute to the stream as a Java int. Writes the next attribute to the stream as aClass SQLOutput, void writeLong(long)Stringin the Java programming language. @param x the value to pass to the database.@exception SQLException if a database access error occurs
Writes the next attribute to the stream as a Java long. Writes the next attribute to the stream as aClass SQLOutput, void writeObject(SQLData)Stringin the Java programming language. @param x the value to pass to the database.@exception SQLException if a database access error occurs
Writes to the stream the data contained in the givenClass SQLOutput, void writeRef(Ref)SQLDataobject. When theSQLDataobject isnullthis method writes an SQLNULLto the stream. Otherwise it calls theSQLData.writeSQLmethod of the given object which writes the object's attributes to the stream. The implementation of the methodSQLData.writeSQcalls the appropriateSQLOutput.writeXXXmethod(s) for writing each of the object's attributes in order. The attributes must be read from anSQLInputinput stream and written to anSQLOutputoutput stream in the same order in which they were listed in the SQL definition of the user-defined type. @param x the object representing data of an SQL structured or distinct type @exception SQLException if a database access error occurs
WritesClass SQLOutput, void writeShort(short)aan SQLREFvalue to the stream. @param x(<structured-type>)anaRefobject representing data of an SQLREFTypevalue @exception SQLException if a database access error occurs
Writes the next attribute to the stream as a Java short. Writes the next attribute to the stream as aClass SQLOutput, void writeString(String)Stringin the Java programming language. @param x the value to pass to the database.@exception SQLException if a database access error occurs
Writes the next attribute to the stream as aClass SQLOutput, void writeStruct(Struct)Stringin the JavaStringprogramming language. @param x the value to pass to the database.@exception SQLException if a database access error occurs
WritesClass SQLOutput, void writeTime(Time)aan SQL structured-type value to the stream. @param xanaStructobject representing data ofa Structuredan SQLTypestructured type @exception SQLException if a database access error occurs
Writes the next attribute to the stream as a java.sql.Time object. Writes the next attribute to the stream as aClass SQLOutput, void writeTimestamp(Timestamp)java.sql.Dateobject in the Java programming language. @param x the value to pass to the database.@exception SQLException if a database access error occurs
Writes the next attribute to the stream as a java.sql.Timestamp object. Writes the next attribute to the stream as ajava.sql.Dateobject in the Java programming language. @param x the value to pass to the database.@exception SQLException if a database access error occurs
Constructs a defaultClass SQLWarning, constructor SQLWarning(String)SQLWarningobject. The reason defaults tonullSQLState defaults tonulland vendorCode defaults to 0.
Constructs anClass SQLWarning, SQLWarning getNextWarning()SQLWarningobject with the given value for a reason; SQLState defaults tonulland vendorCode defaults to 0. @param reason a description of the warning
Retrieves the warning chained to thisSQLWarningobject. @return the nextSQLExceptionin the chain;nullif none
Class Statement, void addBatch(String)The object used for executing a static SQL statement and obtaining the results produced by it.
Only one
ResultSetobject perStatementobject can be open at any point in time. Therefore if the reading of oneResultSetobject is interleaved with the reading of another each must have been generated by differentStatementsStatementobjects. All statementexecutemethods implicitly close a statment's currentResultSetobject if an open one exists. @see Connection#createStatement @see ResultSet
Class Statement, void clearBatch()JDBC 2.0Addsaan SQL command to the current batch of commmands forthethisstatementStatementobject. This method is optional. @param sql typically this is a static SQLINSERTorUPDATEstatement @exception SQLException if a database access error occurs or the driver does not support batch statements @since 1.2 @see What Is in the JDBC 2.0 API
Class Statement, void clearWarnings()JDBC 2.0Makes the set of commands in the current batch empty. This method is optional. @exception SQLException if a database access error occurs or the driver does not support batch statements @since 1.2 @see What Is in the JDBC 2.0 API
Clears all the warnings reported on thisClass Statement, void close()Statementobject. After a call to this method the methodgetWarningswill returnnulluntil a new warning is reported for thisStatementobject. @exception SQLException if a database access error occurs
Releases thisClass Statement, boolean execute(String)Statementobject's database and JDBC resources immediately instead of waiting for this to happen when it is automatically closed. It is generally good practice to release resources as soon as you are finished with them to avoid tying up database resources.Note: A
Statementobject is automatically closed when it is garbage collected. When aStatementobject is closed its currentResultSetobject if one exists is also closed. @exception SQLException if a database access error occurs
ExecutesClass Statement, int[] executeBatch()aan SQL statement that may return multiple results. Under some (uncommon) situations a single SQL statement may return multiple result sets and/or update counts. Normally you can ignore this unless you are (1) executing a stored procedure that you know may return multiple results or (2) you are dynamically executing an unknown SQL string. The methodsexecutegetMoreResultsgetResultSetandgetUpdateCountlet you navigate through multiple results. Theexecutemethod executesaan SQL statement and indicates the form of the first result. You can then use the methodsgetResultSet orgetUpdateCountto retrieve the result andgetMoreResultsto move to any subsequent result(s). @param sql any SQL statement @returntrueif the next result is aResultSetobject;falseif it is an update count or there are no more results @exception SQLException if a database access error occurs @see #getResultSet @see #getUpdateCount @see #getMoreResults
Class Statement, ResultSet executeQuery(String)JDBC 2.0Submits a batch of commands to the database for execution and if all commands execute successfully returns an array of update counts. Theintelements of the array that is returned are ordered to correspond to the commands in the batch which are ordered according to the order in which they were added to the batch. The elements in the array returned by the methodexecuteBatchmay be one of the following:.
- A number greater than or equal to zero -- indicates that the command was processed successfully and is an update count giving the number of rows in the database that were affected by the command's execution
- A value of
-2-- indicates that the command was processed successfully but that the number of rows affected is unknownIf one of the commands in a batch update fails to execute properly this method throws a
BatchUpdateExceptionand a JDBC driver may or may not continue to process the remaining commands in the batch. However the driver's behavior must be consistent with a particular DBMS either always continuing to process commands or never continuing to process commandsThisIf the driver continues processing after a failure the array returned by the methodBatchUpdateException.getUpdateCountswill contain as many elements as there are commands in the batch and at least one of the elements will be the following:
A value of -3-- indicates that the command failed to execute successfully and occurs only if a driver continues to process commands after a command failsA driver is
optionalnot required to implement this method. The possible implementations and return values have been modified in the Java 2 SDK Standard Edition version 1.3 to accommodate the option of continuing to proccess commands in a batch update after aBatchUpdateExceptionobejct has been thrown. @return an array of update counts containing one element for each command in the batch. The elements of the arrayisare ordered according to the order in which commands wereinsertedaddedintoto the batch. @exception SQLException if a database access error occurs or the driver does not support batch statements. Throws BatchUpdateException (a subclass ofSQLException) if one of the commands sent to the database fails to execute properly or attempts to return a result set. @since 1.3 @see What Is in the JDBC 2.0 API
ExecutesClass Statement, int executeUpdate(String)aan SQL statement that returns a singleResultSetobject. @param sql typically this is a static SQLSELECTstatement @return aResultSetobject that contains the data produced by the given query; nevernull@exception SQLException if a database access error occurs
Executes an SQLClass Statement, Connection getConnection()INSERTUPDATEorDELETEstatement. In addition SQL statements that return nothing such as SQL DDL statements can be executed. @param sqlaan SQLINSERTUPDATEorDELETEstatement oraan SQL statement that returns nothing @return either the row count forINSERTUPDATEorDELETEstatements or 0 for SQL statements that return nothing @exception SQLException if a database access error occurs
Class Statement, int getFetchDirection()JDBC 2.0Returns theConnectionobject that produced thisStatementobject. @return the connection that produced this statement @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class Statement, int getFetchSize()JDBC 2.0Retrieves the direction for fetching rows from database tables that is the default for result sets generated from thisStatementobject. If thisStatementobject has not set a fetch direction by calling the methodsetFetchDirectionthe return value is implementation-specific. @return the default fetch direction for result sets generated from thisStatementobject @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Class Statement, int getMaxFieldSize()JDBC 2.0Retrieves the number of result set rows that is the default fetch size for result sets generated from thisStatementobject. If thisStatementobject has not set a fetch size by calling the methodsetFetchSizethe return value is implementation-specific. @return the default fetch size for result sets generated from thisStatementobject @exception SQLException if a database access error occurs @since 1.2 @see What Is in the JDBC 2.0 API
Returns the maximum number of bytes allowed for any column value. This limit is the maximum number of bytes that can be returned for any column value. The limit applies only toClass Statement, int getMaxRows()BINARYVARBINARYLONGVARBINARYCHARVARCHARandLONGVARCHARcolumns. If the limit is exceeded the excess data is silently discarded. @return the current max column size limit; zero means unlimited @exception SQLException if a database access error occurs
Retrieves the maximum number of rows that a ResultSet object can contain. If the limit is exceeded the excess rows are silently dropped. @return the current max row limit; zero means unlimited @exception SQLException if a database access error occurs
Class Statement, boolean getMoreResults()Moves to aClass Statement, int getQueryTimeout()Statementobject's next result. It returnstrueif this result is aResultSetobject. This method also implicitly closes any currentResultSetobject obtained with the methodgetResultSet.There are no more results when the following is true:
( getMoreResults() && (getUpdateCount() == -1) @returntrueif the next result is aResultSetobject;falseif it is an update count or there are no more results @exception SQLException if a database access error occurs @see #execute
Retrieves the number of seconds the driver will wait for aClass Statement, ResultSet getResultSet()Statementobject to execute. If the limit is exceeded aSQLExceptionis thrown. @return the current query timeout limit in seconds; zero means unlimited @exception SQLException if a database access error occurs
Returns the current result as aClass Statement, int getResultSetConcurrency()ResultSetobject. This method should be called only once per result. @return the current result as aResultSetobject;nullif the result is an update count or there are no more results @exception SQLException if a database access error occurs @see #execute
Class Statement, int getResultSetType()JDBC 2.0Retrieves the result set concurrency forResultSetobjects generated by thisStatementobject. @return eitherResultSet.CONCUR_READ_ONLYorResultSet.CONCUR_UPDATABLE@since 1.2 @see What Is in the JDBC 2.0 API
Class Statement, int getUpdateCount()JDBC 2.0 DetermineRetrieves the result set type forResultSetobjects generated by thisStatementobject. @return one ofResultSet.TYPE_FORWARD_ONLYResultSet.TYPE_SCROLL_INSENSITIVE orResultSet.TYPE_SCROLL_SENSITIVE@since 1.2 @see What Is in the JDBC 2.0 API
Returns the current result as an update count; if the result is aClass Statement, SQLWarning getWarnings()ResultSetobject or there are no more results -1 is returned. This method should be called only once per result. @return the current result as an update count; -1 ifitthe current result is aResultSetobject or there are no more results @exception SQLException if a database access error occurs @see #execute
Retrieves the first warning reported by calls on thisClass Statement, void setCursorName(String)Statementobject. SubsequentStatementobject warnings will be chained to thisSQLWarningobject.The warning chain is automatically cleared each time a statement is (re)executed.
Note: If you are processing a
ResultSetobject any warnings associated with reads on thatResultSetreadsobject will be chained onthe ResultSet objectit. @return the firstSQLWarningobject ornull@exception SQLException if a database access error occurs
Defines the SQL cursor name that will be used by subsequentClass Statement, void setEscapeProcessing(boolean)Statementobjectexecutemethods. This name can then be used in SQL positioned update/delete statements to identify the current row in theResultSetobject generated by this statement. If the database doesn't support positioned update/delete this method is a noop. To insure that a cursor has the proper isolation level to support updates the cursor'sSELECTstatement should be of the form 'select for update ...'. If the 'for update' phrase is omitted positioned updates may fail.Note: By definition positioned update/delete execution must be done by a different
Statementobject than the one which generated theResultSetobject being used for positioning. Also cursor names must be unique within a connection. @param name the new cursor name which must be unique within a connection @exception SQLException if a database access error occurs
Sets escape processing on or off. If escape scanning is on (the default) the driver will do escape substitution before sending the SQL to the database. Note: Since prepared statements have usually been parsed prior to making this call disabling escape processing for prepared statements will have no effect. @param enableClass Statement, void setFetchDirection(int)trueto enable;falseto disable @exception SQLException if a database access error occurs
Class Statement, void setFetchSize(int)JDBC 2.0Gives the driver a hint as to the direction in which the rows in a result set will be processed. The hint applies only to result sets created using thisStatementobject. The default value isResultSet.FETCH_FORWARD.Note that this method sets the default fetch direction for result sets generated by this
Statementobject. Each result set has its own methods for getting and setting its own fetch direction. @param direction the initial direction for processing rows @exception SQLException if a database access error occurs or the given direction is not one ofResultSet.FETCH_FORWARDResultSet.FETCH_REVERSEorResultSet.FETCH_UNKNOWN@since 1.2 @see What Is in the JDBC 2.0 API
Class Statement, void setMaxFieldSize(int)JDBC 2.0Gives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed. The number of rows specified affects only result sets created using this statement. If the value specified is zero then the hint is ignored. The default value is zero. @param rows the number of rows to fetch @exception SQLException if a database access error occurs or the condition 0 < rows < this.getMaxRows() is not satisfied. @since 1.2 @see What Is in the JDBC 2.0 API
Sets the limit for the maximum number of bytes in a column to the given number of bytes. This is the maximum number of bytes that can be returned for any column value. This limit applies only toClass Statement, void setMaxRows(int)BINARYVARBINARYLONGVARBINARYCHARVARCHARandLONGVARCHARfields. If the limit is exceeded the excess data is silently discarded. For maximum portability use values greater than 256. @param max the new max column size limit; zero means unlimited @exception SQLException if a database access error occurs
Sets the limit for the maximum number of rows that any ResultSet object can contain to the given number. If the limit is exceeded the excess rows are silently dropped. @param max the new max rows limit; zero means unlimited @exception SQLException if a database access error occurs
Class Statement, void setQueryTimeout(int)Sets the number of seconds the driver will wait for aStatementobject to execute to the given number of seconds. If the limit is exceededaanSQLExceptionis thrown. @param seconds the new query timeout limit in seconds; zero means unlimited @exception SQLException if a database access error occurs
Class Struct, Object[] getAttributes(Map)JDBC 2.0The standard mapping in the Java programming language for an SQL structured type. A
Structobject contains a value for each attribute of the SQL structured type that it represents. By default an instance ofStructis valid as long as the application has a reference to it. @since 1.2 @see What Is in the JDBC 2.0 API
Produces the ordered values of the attributes of the SQL structurec type that thisStructobject represents. This method uses the given type map for customizations of the type mappings. If there is no entry in the given type map that matches the structured type that thisStructobject represents the driver uses the standard mapping. This method never uses the type map associated with the connection.Conceptually this method calls the method
getObjecton each attribute of the structured type and returns a Java array containing the result. @param map a mapping of SQL type names to Java classes @return an array containing the ordered attribute values @exception SQLException if a database access error occurs
Class Time, constructor Time(int, int, int)A thin wrapper around
java.util.Datethat allows JDBC to identify this as a SQLTIMEvalue. TheTimeclass adds formatting and parsing operations to support the JDBC escape syntax for time values.The date components should be set to the "zero epoch" value of January 1 1970 and should not be accessed.
Constructs aClass Time, int getDate()Timeobject initialized with the given values for the hour minute and second. The driver sets the date components to January 1 1970. Any method that attempts to access the date components of aTimeobject will throw ajava.lang.IllegalArgumentException. @param hour 0 to 23 @param minute 0 to 59 @param second 0 to 59 @deprecated Use the constructor that takes a milliseconds value in place of this constructor
This method is deprecated and should not be used because SQLClass Time, int getDay()TimeTIMEvalues do not have a date component. @deprecated @exception java.lang.IllegalArgumentException if this method is invoked
This method is deprecated and should not be used because SQLClass Time, int getMonth()TimeTIMEvalues do not have a day component. @deprecated @exception java.lang.IllegalArgumentException if this method is invoked
This method is deprecated and should not be used because SQLClass Time, int getYear()TimeTIMEvalues do not have a month component. @deprecated @exception java.lang.IllegalArgumentException if this method is invoked
This method is deprecated and should not be used because SQLClass Time, void setDate(int)TimeTIMEvalues do not have a year component. @deprecated @exception java.lang.IllegalArgumentException if this method is invoked
This method is deprecated and should not be used because SQLClass Time, void setMonth(int)TimeTIMEvalues do not have a date component. @deprecated @exception java.lang.IllegalArgumentException if this method is invoked
This method is deprecated and should not be used because SQLClass Time, void setYear(int)TimeTIMEvalues do not have a month component. @deprecated @exception java.lang.IllegalArgumentException if this method is invoked
This method is deprecated and should not be used because SQLClass Time, String toString()TimeTIMEvalues do not have a year component. @deprecated @exception java.lang.IllegalArgumentException if this method is invoked
FormatFormats a time in JDBC date escape format @return aStringin hh:mm:ss format
Class Timestamp, constructor Timestamp(int, int, int, int, int, int, int)
This class is aA thin wrapper aroundjava.util.Datethat allows the JDBC API to identify this asaan SQLTIMESTAMPvalue. It adds the ability to hold the SQLTIMESTAMPnanos value and provides formatting and parsing operations to support the JDBC escape syntax for timestamp values.Note: This type is a composite of a
java.util.Dateand a separatenanosnanoseconds value. Only integral seconds are stored in thejava.util.Datecomponent. The fractional seconds - the nanos - are separate. ThegetTimemethod will return only integral seconds. If a time value that includes the fractional seconds is desired you must convert nanos to milliseconds (nanos/1000000) and add this to thegetTimevalue. TheTimestamp.equals(Object)method never returnstruewhen passed a value of typejava.util.Datebecause the nanos component of a date is unknown. As a result theTimestamp.equals(Object)method is not symmetric with respect to thejava.util.Date.equals(Object)method. Also thehashcodemethod uses the underlyingjava.util.Dataimplementation and therefore does not include nanos in its computation. Due to the differences between theTimestampclass and thejava.util.Dateclass mentioned above it is recommended that code not viewTimestampvalues generically as an instance ofjava.util.Date. The inheritance relationship betweenTimestampandjava.util.Datereally denotes implementation inheritance and not type inheritance.
Constructs aClass Timestamp, boolean after(Timestamp)Timestampobject initialized with the given values. @param year year-1900 @param month 0 to 11 @paramdaydate 1 to 31 @param hour 0 to 23 @param minute 0 to 59 @param second 0 to 59 @param nano 0 to 999 999 999 @deprecated instead use the constructorTimestamp(long millis)
Indicates whether thisClass Timestamp, boolean before(Timestamp)Timestampobject is later than the givenTimestampobject.Is this timestamp later than the timestamp argument@param ts theTimestampvalue to compare with @returntrueif thisTimestampobject is later;falseotherwise
Indicates whether thisClass Timestamp, boolean equals(Object)Timestampobject is earlier than the givenTimestampobject. @param ts theTimestampvalue to compare with @returntrueif thisTimestampobject is earlier;falseotherwise
Tests to see if thisClass Timestamp, void setNanos(int)Timestampobject is equal to the given object. This version of the methodequalshas been added to fix the incorrect signature ofTimestamp.equals(Timestamp)and to preserve backward compatibility with existing class files. Note: This method is not symmetric with respect to theequals(Object)method in the base class. @param ts theObjectvalue to compare with
Sets thisClass Timestamp, String toString()Timestampobject'snanosvaluefield to the given value. @param n the new fractional seconds component @exception java.lang.IllegalArgumentException if the given argument is greater than 999999999 or less than 0
Formats a timestamp in JDBC timestamp escape format. @return aClass Timestamp, Timestamp valueOf(String)Stringobject inyyyy-mm-dd hh:mm:ss.fffffffffformat @overridestoStringin classjava.util.Date
Converts astringStringobject in JDBC timestamp escape format to aTimestampvalue. @param s timestamp in formatyyyy-mm-dd hh:mm:ss.fffffffff@return correspondingTimestampvalue @exception java.lang.IllegalArgumentException if the given argument does not have the formatyyyy-mm-dd hh:mm:ss.fffffffff
Class Types, int ARRAYThe class that defines the constants that are used to identify generic SQL types called JDBC types. The actual type constant values are equivalent to those in XOPEN.
This class is never instantiated.
Class Types, int BLOBJDBCThe2.0constant in the Java programming languageAsometimes referred to as a typerepresenting ancode that identifies the generic SQL typeARRAY. @since 1.2 @see What Is in the JDBC 2.0 API
Class Types, int CLOBJDBCThe2.0constant in the Java programmingAlanguage sometimes referred to as a typerepresentingcode that identifies theangeneric SQLBinarytypeBLOB. @since 1.2 @seeLargeWhatObjectIs in the JDBC 2.0 API
Class Types, int DISTINCTJDBCThe2.0constant in the Java programmingAlanguage sometimes referred to as a typerepresentingcode that identifies theangeneric SQLCharactertypeCLOB. @since 1.2 @seeLargeWhatObjectIs in the JDBC 2.0 API
Class Types, int JAVA_OBJECTJDBCThe2.0constantAintypethe Javabased onprogramming language sometimes referred to as abuilt-intype code that identifies the generic SQL typeDISTINCT.One@since 1.2of@seetheWhattwoIsuser-definedindata typesthe JDBC(UDTs)2.0 API
Class Types, int OTHERJDBCThe2.0constantAintypethe Java programming language sometimesrepresentingreferred to as aJavatype code that identifies the genericObjectSQL typeJAVA_OBJECT. @since 1.2 @see What Is in the JDBC 2.0 API
Class Types, int REFOTHERThe constant in the Java programming language that indicates that the SQL type is database-specific and gets mapped to a Java object that can be accessed via the methodsgetObjectandsetObject.
Class Types, int STRUCTJDBCThe2.0constant in the Java programming languageAsometimes referred to as a typerepresenting ancode that identifies the generic SQL typeREF. @since 1.2 @see What Is in the JDBC 2.0 API
JDBCThe2.0constantAintypethe Java programming language sometimes referred to asconsisting of attributesa type code thatmayidentifies thebe anygeneric SQL typeSTRUCT.One@sinceof1.2the@seetwoWhatuser-definedIsdataintypesthe JDBC(UDTs)2.0 API