|
Generated by JDiff |
||||||||
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES |
This file contains all the changes in documentation in the packagejava.sql
as 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()The mapping in the Java programming language for the SQL typeARRAY
. By default anArray
objectvalue is a transaction-duration reference to an SQLARRAY
value. By default anArray
object is implemented using an SQL LOCATOR(array) internally which means that anArray
object contains a logical pointer to the data in the SQLARRAY
valueon the serverrather than containing theARRAY
value's data.The
Array
interface provides methods for bringing an SQLARRAY
value's data to the client as either an array or aResultSet
object.If the elements of the SQLARRAY
are 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
Class
object for the class implementingSQLData
When a type map with an entry for the base type is supplied to the methods
getArray
andgetResultSet
the mapping it contains will be used to map the elements of theARRAY
value. 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@sinceAPI1.2
Retrieves the contents of the SQLClass Array, Object getArray(Map)ARRAY
value designated by thisArray
object in the form of an array in the Java programming language. This version of the methodgetArray
uses 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 SQLARRAY
value designated by thisArray
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 SQLClass Array, Object getArray(long, int)arrayARRAY
value designated by thisArray
object. This method uses the specifiedmap
for type map customizations unless the base type of the array does not match a user-defined type inmap
in which case it uses the standard mapping. This version of the methodgetArray
uses either the given type map or the standard mapping; it never uses the type map associated with the connection. @param map ajava.util.Map
object 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
Class Array, Object getArray(long, int, Map)ReturnsRetrievesan array containinga slice of the SQLARRAY
value designated by thisArray
object beginning with the specifiedindex
and containing up tocount
successive 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 tocount
consecutive 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
Class Array, int getBaseType()ReturnsRetreivesan array containinga slice of the SQLarrayARRAY
objectvalue designated by thisArray
object beginning with the specifiedindex
and containing up tocount
successive elements of the SQL array.This method uses the specified
map
for type map customizations unless the base type of the array does not match a user-defined type inmap
in which case it uses the standard mapping. This version of the methodgetArray
uses 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.Map
object that contains SQL type names and the classes in the Java programming language to which they are mapped @return an array containing up tocount
consecutive elements of the SQLarrayARRAY
value designated by thisArray
object 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
Class Array, String getBaseTypeName()ReturnsRetrieves the JDBC type of the elements in the array designated by thisArray
object. @return a constant from the class java.sql.Types that is the type code for the elements in the array designated by thisArray
object.@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
Class Array, ResultSet getResultSet()ReturnsRetrieves the SQL type name of the elements in the array designated by thisArray
object. 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 aString
that 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
Class Array, ResultSet getResultSet(Map)ReturnsRetrieves a result set that contains the elements of the SQLARRAY
value designated by thisArray
object. 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
Array
object 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
Class Array, ResultSet getResultSet(long, int)ReturnsRetrieves a result set that contains the elements of the SQLARRAY
value designated by thisArray
object. This method uses the specifiedmap
for type map customizations unless the base type of the array does not match a user-defined type inmap
in which case it uses the standard mapping. This version of the methodgetResultSet
uses either the given type map or the standard mapping; it never uses the type map associated with the 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 programming language @return a
ResultSet
object containing one row for each of the elements in the array designated by thisArray
object 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
Class Array, ResultSet getResultSet(long, int, Map)ReturnsRetrieves a result set holding the elements of the subarray that starts at indexindex
and contains up tocount
successive 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 tocount
rows in ascending order based on the indices. Each row has two columns: The second column stores the element value; the first column stores 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 aResultSet
object containing up tocount
consecutive elements of the SQL array designated by thisArray
object 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
ReturnsRetrieves a result set holding the elements of the subarray that starts at indexindex
and contains up tocount
successive elements. This method uses the specifiedmap
for type map customizations unless the base type of the array does not match a user-defined type inmap
in which case it uses the standard mapping. This version of the methodgetResultSet
uses 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 tocount
rows 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 theMap
object that contains the mapping of SQL type names to classes in the Java(tm) programming language @return aResultSet
object containing up tocount
consecutive elements of the SQL array designated by thisArray
object 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
An exception thrown when an error occurs during a batch update operation. In addition to the information provided by SQLException aClass BatchUpdateException, constructor BatchUpdateException()BatchUpdateException
provides 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
BatchUpdateException
is 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.getUpdateCounts
will 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.
-3Statement.EXECUTE_FAILED
This class is new in the JDBC 2.0@sinceAPI1.2
Constructs aClass BatchUpdateException, constructor BatchUpdateException(String, String, int, int[])BatchUpdateException
object with the reason SQLState and update count initialized tonull
and the vendor code initialized to 0. @since 1.2@see What Is in the JDBC 2.0 API
Constructs a fully-specifiedClass BatchUpdateException, constructor BatchUpdateException(String, String, int[])BatchUpdateException
object 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 code used by a particular database vendor @param updateCounts an array ofint
with 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[])BatchUpdateException
initialized with the given arguments (reason
SQLState
andupdateCounts
) 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 ofint
with 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[])BatchUpdateException
initialized withreason
updateCounts
andnull
for the SQLState and 0 for the vendorCode. @param reason a description of the exception @param updateCounts an array ofint
with 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()BatchUpdateException
initialized tonull
for the reason and SQLState and 0 for the vendor code. @param updateCounts an array ofint
with 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 theBatchUpdateException
was 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
BatchUpdateException
object has been thrown. @return an array ofint
containing 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
- an update count
to indicate that the command executed successfully but the number of rows affected is unknown
-2Statement.SUCCESS_NO_INFOto indicate that the command failed to execute successfully
-3Statement.EXECUTE_FAILED@see What Is in the JDBC 2.0 API
The representation (mapping) in the JavaTM programming language of an SQLClass Blob, InputStream getBinaryStream()BLOB
value. An SQLBLOB
is a built-in type that stores a Binary Large Object as a column value in a row of a database table.TheBy defaultdriver implementsdrivers implementBlob
using an SQLlocator(BLOB)
which means that aBlob
object contains a logical pointer to the SQLBLOB
data rather than the data itself. ABlob
object is valid for the duration of the transaction in which is was created.Methods in the interfaces ResultSet CallableStatement and PreparedStatement such as
getBlob
andsetBlob
allow a programmer to access an SQLBLOB
value. TheBlob
interface provides methods for getting the length of an SQLBLOB
(Binary Large Object) value for materializing aBLOB
value on the client and for determining the position of a pattern of bytes within aBLOB
value. InThis class is new in the JDBCaddition this interface has methods for updating2.0aBLOB
APIvalue. @since 1.2
Retrieves theClass Blob, byte[] getBytes(long, int)BLOB
value designated by thisBlob
instance as a stream. @return a stream containing theBLOB
data @exception SQLException if there is an error accessing theBLOB
@since 1.2value @seeWhat Is in#setBinaryStreamthe JDBC@since21.0 API2
Class Blob, long length()ReturnsRetrievesas an array of bytes partall orallpart of theBLOB
value that thisBlob
objectdesignatesrepresents as an array of bytes.TheThisbyte
array contains up tolength
consecutive bytes starting at positionpos
. @param pos the ordinal position of the first byte in theBLOB
value to be extracted; the first byte is at position 1 @param length the number of consecutive bytes to be copied @return a byte array containing up tolength
consecutive bytes from theBLOB
value designated by thisBlob
object starting with the byte at positionpos
@exception SQLException if there is an error accessing theBLOB
@since 1.2value @seeWhat#setBytesIs in the JDBC@since21.0 API2
Returns the number of bytes in theClass Blob, long position(Blob, long)BLOB
value designated by thisBlob
object. @return length of theBLOB
in 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
Class Blob, long position(byte[], long)DeterminesRetrieves the byte position in theBLOB
value designated by thisBlob
object at whichpattern
begins. The search begins at positionstart
. @param pattern theBlob
object designating theBLOB
value for which to search @param start the position in theBLOB
value 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
value @since 1.2@see What Is in the JDBC 2.0 API
DeterminesRetrieves the byte position at which the specified byte arraypattern
begins within theBLOB
value that thisBlob
object represents. The search forpattern
begins 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. The JDBC API 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 number with the first parameter being 1.Class CallableStatement, Array getArray(int){ = 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 theget
methods provided here.A
CallableStatement
can return one ResultSet object or multipleResultSet
objects. MultipleResultSet
objects are handled using operations inherited from StatementFor maximum portability a call's
ResultSet
objects 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)GetsRetrieves the value ofathe designated JDBCARRAY
parameter 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 anArray
object in the Java programming language. If the value was SQLNULL
the valuenull
is 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)GetsRetrieves the value ofathe designated JDBCNUMERIC
parameter as ajava.math.BigDecimal
object 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 SQLNULL
the result isnull
. @exception SQLException if a database access error occurs @since 1.2 @seeWhat Is#setBigDecimalin the JDBC@since21.0 API2
Class CallableStatement, Blob getBlob(int)GetsRetrieves the value ofathe designated JDBCNUMERIC
parameter as ajava.math.BigDecimal
object 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 SQLNULL
the result isnull
. @exception SQLException if a database access error occurs @deprecated usegetBigDecimal(int parameterIndex)
orgetBigDecimal(String parameterName)
@see #setBigDecimal
Class CallableStatement, boolean getBoolean(int)GetsRetrieves the value ofathe designated JDBCBLOB
parameter 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 aBlob
object in the Java programming language. If the value was SQLNULL
the valuenull
is returned. @exception SQLException if a database access error occurs @since 1.2@see What Is in the JDBC 2.0 API
Class CallableStatement, byte getByte(int)GetsRetrieves the value ofathe designated JDBCBIT
parameter as aboolean
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 SQLNULL
the result isfalse
. @exception SQLException if a database access error occurs @see #setBoolean
Class CallableStatement, byte[] getBytes(int)GetsRetrieves the value ofathe designated JDBCTINYINT
parameter as abyte
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 SQLNULL
the result is0
. @exception SQLException if a database access error occurs @see #setByte
Class CallableStatement, Clob getClob(int)GetsRetrieves the value ofathe designated JDBCBINARY
orVARBINARY
parameter as an array ofbyte
values 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 SQLNULL
the result isnull
. @exception SQLException if a database access error occurs @see #setBytes
Class CallableStatement, Date getDate(int)GetsRetrieves the value ofathe designated JDBCCLOB
parameter as aClob
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 aClob
object in the Java programming language. If the value was SQLNULL
the valuenull
is returned. @exception SQLException if a database access error occurs @since 1.2@see What Is in the JDBC 2.0 API
Class CallableStatement, Date getDate(int, Calendar)GetsRetrieves the value ofathe designated JDBCDATE
parameter as ajava.sql.Date
object. @param parameterIndex the first parameter is 1 the second is 2 and so on @return the parameter value. If the value is SQLNULL
the result isnull
. @exception SQLException if a database access error occurs @see #setDate
Class CallableStatement, double getDouble(int)GetsRetrieves the value ofathe designated JDBCDATE
parameter as ajava.sql.Date
object using the givenCalendar
object to construct the date. With aCalendar
object the driver can calculate the date taking into account a custom timezone and locale. If noCalendar
object 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 theCalendar
object the driver will use to construct the date @return the parameter value. If the value is SQLNULL
the result isnull
. @exception SQLException if a database access error occurs @see #setDate @since 1.2
Class CallableStatement, float getFloat(int)GetsRetrieves the value ofathe designated JDBCDOUBLE
parameter as adouble
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 SQLNULL
the result is0
. @exception SQLException if a database access error occurs @see #setDouble
Class CallableStatement, int getInt(int)GetsRetrieves the value ofathe designated JDBCFLOAT
parameter as afloat
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 SQLNULL
the result is0
. @exception SQLException if a database access error occurs @see #setFloat
Class CallableStatement, long getLong(int)GetsRetrieves the value ofathe designated JDBCINTEGER
parameter as anint
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 SQLNULL
the result is0
. @exception SQLException if a database access error occurs @see #setInt
Class CallableStatement, Object getObject(int)GetsRetrieves the value ofathe designated JDBCBIGINT
parameter as along
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 SQLNULL
the result is0
. @exception SQLException if a database access error occurs @see #setLong
Class CallableStatement, Object getObject(int, Map)GetsRetrieves the value ofathe designated parameter as anObject
in the Java programming language. If the value is an SQLNULL
the driver returns a Javanull
.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.OTHER
this method can be used to read database-specific abstract data types. @param parameterIndex the first parameter is 1 the second is 2 and so on @return Ajava.lang.Object
holding the OUT parameter value.@exception SQLException if a database access error occurs @see Types @see #setObject
Returns an object representing the value of OUT parameterClass CallableStatement, Ref getRef(int)i
and usesmap
for 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.OTHER
this 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.Object
holding the OUT parameter value @exception SQLException if a database access error occurs @since 1.2 @seeWhat Is in#setObjectthe JDBC@since21.0 API2
Class CallableStatement, short getShort(int)GetsRetrieves the value ofathe designated 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 aRef
object in the Java programming language. If the value was SQLNULL
the valuenull
is returned. @exception SQLException if a database access error occurs @since 1.2@see What Is in the JDBC 2.0 API
Class CallableStatement, String getString(int)GetsRetrieves the value ofathe designated JDBCSMALLINT
parameter as ashort
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 SQLNULL
the result is0
. @exception SQLException if a database access error occurs @see #setShort
Retrieves the value ofClass CallableStatement, Time getTime(int)athe designated JDBCCHAR
VARCHAR
orLONGVARCHAR
parameter as aString
in the Java programming language.For the fixed-length type JDBC
CHAR
theString
object returned has exactly the same value the JDBCCHAR
value 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 SQLNULL
the result isnull
. @exception SQLException if a database access error occurs @see #setString
Class CallableStatement, Time getTime(int, Calendar)GetRetrieves the value ofathe designated JDBCTIME
parameter as ajava.sql.Time
object. @param parameterIndex the first parameter is 1 the second is 2 and so on @return the parameter value. If the value is SQLNULL
the result isnull
. @exception SQLException if a database access error occurs @see #setTime
Class CallableStatement, Timestamp getTimestamp(int)GetsRetrieves the value ofathe designated JDBCTIME
parameter as ajava.sql.Time
object using the givenCalendar
object to construct the time. With aCalendar
object the driver can calculate the time taking into account a custom timezone and locale. If noCalendar
object 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 theCalendar
object the driver will use to construct the time @return the parameter value; if the value is SQLNULL
the result isnull
. @exception SQLException if a database access error occurs @see #setTime @since 1.2
Class CallableStatement, Timestamp getTimestamp(int, Calendar)GetsRetrieves the value ofathe designated JDBCTIMESTAMP
parameter as ajava.sql.Timestamp
object. @param parameterIndex the first parameter is 1 the second is 2 and so on @return the parameter value. If the value is SQLNULL
the result isnull
. @exception SQLException if a database access error occurs @see #setTimestamp
Class CallableStatement, void registerOutParameter(int, int, String)GetsRetrieves the value ofathe designated JDBCTIMESTAMP
parameter as ajava.sql.Timestamp
object using the givenCalendar
object to construct theTimestamp
object. With aCalendar
object the driver can calculate the timestamp taking into account a custom timezone and locale. If noCalendar
object 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 theCalendar
object the driver will use to construct the timestamp @return the parameter value. If the value is SQLNULL
the result isnull
. @exception SQLException if a database access error occurs @see #setTimestamp @since 1.2
Registers the designated output parameter. This version of the methodClass CallableStatement, void registerOutParameter(int, int, int)registerOutParameter
should be used for a user-nameddefined orREF
output parameter. Examples of user-nameddefined types include:STRUCT
DISTINCT
JAVA_OBJECT
and named array types. Before executing a stored procedure call you must explicitly callregisterOutParameter
to register the type fromjava.sql.Types
for each OUT parameter. For a user-nameddefined parameter the fully-qualified SQL type name of the parameter should also be given while aREF
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-nameddefined andREF
parameters. Although it is intended for user-nameddefined andREF
parameters this method may be used to register a parameter of any JDBC type. If the parameter does not have a user-nameddefined orREF
type the typeName parameter is ignored.Note: When reading the value of an out parameter you must use the
getXXXgetter method whose Java typeXXXcorresponds to the parameter's registered SQL type. @paramparameterIndexparamIndex 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
Registers the parameter in ordinal positionClass CallableStatement, boolean wasNull()parameterIndex
to be of JDBC typesqlType
. This method must be called before a stored procedure is executed.The JDBC type specified by
sqlType
for an OUT parameter determines the Java type that must be used in theget
method to read the value of that parameter.This version of
registerOutParameter
should be used when the parameter is of JDBC typeNUMERIC
orDECIMAL
. @param parameterIndex the first parameter is 1 the second is 2 and so on @param sqlType the SQL type code defined byjava.sql.Types
. @param scale the desired number of digits to the right of the decimal point. It must be greater than or equal to zero. @exception SQLException if a database access error occurs @see Types
IndicatesRetrieves whetheror notthe last OUT parameter read had the value of SQLNULL
. Note that this method should be called only after calling agetXXXgetter method; otherwise there is no value to use in determining whether it isnull
or not. @returntrue
if the last parameter read was SQLNULL
;false
otherwise @exception SQLException if a database access error occurs
The mapping in the JavaTM programming language for the SQLClass Clob, InputStream getAsciiStream()CLOB
type. An SQLCLOB
is a built-in type that stores a Character Large Object as a column value in a row of a database table.TheBy defaultdriver implementsdrivers implement aClob
object using an SQLlocator(CLOB)
which means that aClob
object contains a logical pointer to the SQLCLOB
data rather than the data itself. AClob
object is valid for the duration of the transaction in which it was created.The
Clob
interface provides methods for getting the length of an SQLCLOB
(Character Large Object) value for materializing aCLOB
value on the client and for searching for a substring orCLOB
object within aCLOB
value. Methods in the interfaces ResultSet CallableStatement and PreparedStatement such asgetClob
andsetClob
allow a programmer to access an SQLCLOB
value. InThis class is new in the JDBCaddition this interface has methods for updating2aCLOB
value.0API@since 1.2
Class Clob, Reader getCharacterStream()GetsRetrieves theCLOB
value designated by thisClob
object asa stream ofanAscii bytesascii stream. @returnanaasciijava.io.InputStream
streamobject containing theCLOB
data @exception SQLException if there is an error accessing theCLOB
value @since 1.2 @seeWhat Is in#setAsciiStreamthe JDBC@since21.0 API2
Class Clob, String getSubString(long, int)GetsRetrieves theCLOB
value designated by thisClob
object as aUnicodejava.io.Reader
object (or as a stream of characters). @return aUnicodejava.io.Reader
streamobject containing theCLOB
data @exception SQLException if there is an error accessing theCLOB
value @since 1.2 @seeWhat Is#setCharacterStreamin the JDBC@since21.0 API2
Class Clob, long length()ReturnsRetrieves a copy of the specified substring in theCLOB
value designated by thisClob
object. The substring begins at positionpos
and has up tolength
consecutive 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 aString
that is the specified substring in theCLOB
value designated by thisClob
object @exception SQLException if there is an error accessing theCLOB
value @since 1.2@see What Is in the JDBC 2.0 API
Class Clob, long position(Clob, long)ReturnsRetrieves the number of characters in theCLOB
value designated by thisClob
object. @return length of theCLOB
in characters @exception SQLException if there is an error accessing the length of theCLOB
value @since 1.2@see What Is in the JDBC 2.0 API
Class Clob, long position(String, long)DeterminesRetrieves the character position at which the specifiedClob
objectsearchstr
appears in thisClob
object. The search begins at positionstart
. @param searchstr theClob
object for which to search @param start the position at which to begin searching; the first position is 1 @return the position at which theClob
object appearselseor -1 if it is not present; the first position is 1 @exception SQLException if there is an error accessing theCLOB
value @since 1.2@see What Is in the JDBC 2.0 API
DeterminesRetrieves the character position at which the specified substringsearchstr
appears in the SQLCLOB
value represented by thisClob
object. 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 appearselseor -1 if it is not present; the first position is 1 @exception SQLException if there is an error accessing theCLOB
value @since 1.2@see What Is in the JDBC 2.0 API
Class Connection, void clearWarnings()A connection (session) with a specific database.
Within the context of a ConnectionSQL statements are executed and results are returned within the context of a connection.A
Connection
object'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 thegetMetaData
method.Note: By default
theaConnection
object is in auto-commit mode which means that it automatically commits changes after executing each statement. If auto-commit mode has been disabled the methodcommit
must be called explicitly in order to commit changes; otherwise database changes will not be saved.@see
DriverManager#getConnectionA@seenewStatementConnection
@seeobject created using the JDBC 2.1 core API has an initially empty type map associated with it. A user may enter a custom mapping for a UDT in this type map. When a UDT is retrieved from a data source with the methodResultSet.getObject
@thegetObject
method will check the connection's type map to seeDatabaseMetaDataif there is anMethodsentry for thatareUDT. If so thegetObject
method will map the UDT to the class indicated. If there is no entry the UDT will be mapped using the standard mapping.A user may create a new type map which is a
java.util.Map
object make an entry in it and pass it to theJDBCjava.sql
2methods that can perform custom mapping.0API are taggedIn this case@sincethe1method will use the given type map instead of the one associated with the connection.2For example the following code fragment specifies that the SQL type
ATHLETES
will be mapped to the classAthletes
in the Java programming language. The code fragment retrieves the type map for theConnection
objectcon
inserts the entry into it and then sets the type map with the new entry as the connection's type map.java.util.Map map = con.getTypeMap(); map.put("mySchemaName.ATHLETES" Class.forName("Athletes")); con.setTypeMap(map); @see DriverManager#getConnection @see Statement @see ResultSet @see DatabaseMetaData
Clears all warnings reported for thisClass Connection, void close()Connection
object. After a call to this method the methodgetWarnings
returnsnull
until a new warning is reported for thisConnection
object. @exception SQLException if a database access error occurs
ReleasesClass Connection, void commit()athisConnection
object's database and JDBC resources immediately instead of waiting for them to be automatically released.Calling the method
close
on aConnection
object that is already closed is a no-op.Note: A
Connection
object is automatically closed when it is garbage collected. Certain fatal errors alsoresultcloseinaclosedConnection
object. @exception SQLException if a database access error occurs
Makes all changes made since the previous commit/rollback permanent and releases any database locks currently held byClass Connection, Statement createStatement()thethisConnection
object. This method should be used only when auto-commit mode has been disabled. @exception SQLException if a database access error occurs or thisConnection
object is in auto-commit mode @see #setAutoCommit
Creates aClass Connection, Statement createStatement(int, int)Statement
object for sending SQL statements to the database. SQL statements without parameters are normally executed usingStatement
objects. If the same SQL statement is executed many times itismay be more efficient to use aPreparedStatement
object.Result sets created using the returned
Statement
object will by defaulthave forward-onlybe typeTYPE_FORWARD_ONLY
andread-onlyhave a concurrency level ofCONCUR_READ_ONLY
. @return a new defaultStatement object @exception SQLException if a database access error occurs
Creates aClass Connection, boolean getAutoCommit()Statement
object that will generateResultSet
objects with the given type and concurrency. This method is the same as thecreateStatement
method above but it allows the default result set type andresult setconcurrencytypeto be overridden. @param resultSetType a result set type;seeone ofResultSet.TYPE_FORWARD_ONLY
ResultSet.TYPE_SCROLL_INSENSITIVE
orResultSet.TYPE_
@param resultSetConcurrency a concurrency type;XXXSCROLL_SENSITIVEseeone ofResultSet.CONCUR_READ_ONLY
orResultSet.CONCUR_
@return a newXXXUPDATABLEStatement
object that will generateResultSet
objects with the given type and concurrency @exception SQLException if a database access error occurs@sinceor1.2the@seegivenWhatparametersIs inare nottheResultSet
JDBCconstants2.0indicating type and concurrency @sinceAPI1.2
Class Connection, String getCatalog()GetsRetrieves the current auto-commitstatemode for thisConnection
object. @return the current state of thisConnection
object's auto-commit mode @exception SQLException if a database access error occurs @see #setAutoCommit
Class Connection, DatabaseMetaData getMetaData()Returns theRetrieves thisConnection
object's current catalog name. @return the current catalog name ornull
if there is none @exception SQLException if a database access error occurs @see #setCatalog
Class Connection, int getTransactionIsolation()Gets theRetrieves ametadataDatabaseMetaData
regarding thisobject thatconnection'scontains metadata about the database.toAwhich thisConnection
'sdatabase is ableobject represents atoconnection. The metadataprovideincludes informationdescribingaboutitsthe database's tables its supported SQL grammar its stored procedures the capabilities of this connection and so on.This information is made available through a DatabaseMetaData object.@return aDatabaseMetaData
object for thisConnection
object @exception SQLException if a database access error occurs
Class Connection, Map getTypeMap()GetsRetrieves thisConnection
object's current transaction isolation level. @return the current transaction isolation level which will be one of the following constants:Connection.TRANSACTION_READ_UNCOMMITTED
Connection.TRANSACTION_READ_COMMITTED
Connection.TRANSACTION_REPEATABLE_READ
Connection.
TRANSACTION_*SERIALIZABLEmodeorvalueConnection.TRANSACTION_NONE
. @exception SQLException if a database access error occurs @see #setTransactionIsolation
Class Connection, SQLWarning getWarnings()GetsRetrieves thetype mapMap
object associated with thisconnectionConnection
object. Unless the application has added an entrytothe type mapthe mapreturned will be empty. @return thejava.util.Map
object associated with thisConnection
object @sinceexception1.2SQLException@seeifWhataIs in the JDBCdatabase access error occurs2@since 1.02 @seeAPI#setTypeMap
Class Connection, boolean isClosed()ReturnsRetrieves the first warning reported by calls on thisConnection
object. If there is more than one warning subsequent warnings will be chained to the first one and can be retrieved by calling the methodSQLWarning.getNextWarning
on the warning that was retrieved previously.This method may not be called on a closed connection; doing so will cause an
.SQLException
to be thrownNote: Subsequent warnings will be chained to this SQLWarning. @return the first
SQLWarning
object ornull
if there are none @exception SQLException if a database access error occurs or this method is called on a closed connection @see SQLWarning
Class Connection, boolean isReadOnly()TestsRetrievestowhether thisConnection
object has been closed. A connection isseeclosed ifathe methodclose
has been called on it or if certain fatal errors have occurred. This method is guaranteed to returntrue
only when it is called after the methodConnection.close has been called.
This method generally cannot be called to determine whether a connection to a database
isclosedvalid or invalid. A typical client can determine that a connection is invalid by catching any exceptions that might be thrown when an operation is attempted. @returntrue
ifthethisconnectionConnection
object is closed;false
if it'sis still open @exception SQLException if a database access error occurs
Class Connection, String nativeSQL(String)Tests to seeRetrieves whether thisif theConnection
connectionobject is in read-only mode. @returntrue
ifconnectionthisConnection
object is read-onlyand;false
otherwise @exception SQLException if a database access error occurs
Converts the given SQL statement into the system's native SQL grammar. A driver may convert the JDBCClass Connection, CallableStatement prepareCall(String)sqlSQL grammar into its system's native SQL grammar prior to sending it;.thisThis method returns the native form of the statement that the driver would have sent. @param sqlaan SQL statement that may contain one or more ' ' parameter placeholders @return the native form of this statement @exception SQLException if a database access error occurs
Creates aClass Connection, CallableStatement prepareCall(String, int, int)CallableStatement
object for calling database stored procedures. TheCallableStatement
object 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
prepareCall
is done; others may wait until theCallableStatement
object is executed. This has no direct effect on users; however it does affect which method throws certain SQLExceptions.Result sets created using the returned
CallableStatement
object willhavebyforward-onlydefault be typeTYPE_FORWARD_ONLY
andread-onlyhave a concurrencybyleveldefaultofCONCUR_READ_ONLY
. @param sqlaan SQL statement that may contain one or more ' ' parameter placeholders. Typically this statement is a JDBC function call escape string. @return a new defaultCallableStatement object containing the pre-compiled SQL statement @exception SQLException if a database access error occurs
Creates aClass Connection, PreparedStatement prepareStatement(String)CallableStatement
object that will generateResultSet
objects with the given type and concurrency. This method is the same as theprepareCall
method above but it allows the default result set type andresult setconcurrencytypeto be overridden. @param sql aString
object that is the SQL statement to be sent to the database; may contain on or more parameters @param resultSetType a result set type;seeone ofResultSet.TYPE_FORWARD_ONLY
ResultSet.TYPE_SCROLL_INSENSITIVE
orResultSet.TYPE_
@param resultSetConcurrency a concurrency type;XXXSCROLL_SENSITIVEseeone ofResultSet.CONCUR_READ_ONLY
orResultSet.CONCUR_
@return a newXXXUPDATABLECallableStatement
object containing the pre-compiled SQL statement that will produceResultSet
objects with the given type and concurrency @exception SQLException if a database access error occurs@sinceor1.2the@seegivenWhatparametersIs inare nottheResultSet
JDBCconstants2.0indicating type andAPIconcurrency @since 1.2
Creates aClass Connection, void rollback()PreparedStatement
object 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
prepareStatement
will 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 thePreparedStatement
object is executed. This has no direct effect on users; however it does affect whichmethod throwsmethods throw certainSQLExceptionsSQLException
objects.Result sets created using the returned
PreparedStatement
object willhavebyforward-onlydefault be typeTYPE_FORWARD_ONLY
andread-onlyhave a concurrencybyleveldefaultofCONCUR_READ_ONLY
. @param sqlaan SQL statement that may contain one or more ' ' IN parameter placeholders @return a new defaultPreparedStatement object containing the pre-compiled SQL statement @exception SQLException if a database access error occurs
Class Connection, void setAutoCommit(boolean)DropsUndoes all changes madesincein thepreviouscurrentcommit/rollbacktransaction and releases any database locks currently held by thisConnection
object. This method should be used only when auto-commit mode has been disabled. @exception SQLException if a database access error occurs or thisConnection
object is in auto-commit mode @see #setAutoCommit
Sets this connection's auto-commit mode to the given state. If a connection is in auto-commit mode then all its SQL statements will be executed and committed as individual transactions. Otherwise its SQL statements are grouped into transactions that are terminated by a call to either the methodClass Connection, void setCatalog(String)commit
or the methodrollback
. By default new connections are in auto-commit mode.The commit occurs when the statement completes or the next execute occurs whichever comes first. In the case of statements returning a
ResultSet
object the statement completes when the last row of theResultSet
object has been retrieved or theResultSet
object has been closed. In advanced cases a single statement may return multiple results as well as output parameter values. In these cases the commit occurs when all results and output parameter values have been retrieved.NOTE: If this method is called during a transaction the transaction is committed. @param autoCommit
true
toenablesenable auto-commit mode;false
disablestoauto-commit.disable it @exception SQLException if a database access error occurs @see #getAutoCommit
SetsClass Connection, void setReadOnly(boolean)athe given catalog name in order to select a subspace of thisConnection
object's database in which to work.If the driver does not support catalogs it will silently ignore this request. @param catalog the name of a catalog (subspace in this
Connection
object's database) in which to work @exception SQLException if a database access error occurs @see #getCatalog
Puts this connection in read-only mode as a hint to the driver to enable database optimizations.Class Connection, void setTransactionIsolation(int)Note: This method cannot be called
while in the middleduringofa transaction. @param readOnlytrue
enables read-only mode;false
disablesread-only mode.it @exception SQLException if a database access error occurs or this method is called during a transaction
Attempts to change the transaction isolation level for thisClass Connection, void setTypeMap(Map)Connection
object to the one given. The constants defined in the interfaceConnection
are the possible transaction isolation levels.Note:
This method cannot beIf this method is calledwhileduringin the middle of aa transaction the result istransactionimplementation-defined. @param level one of the followingConnection
constants:Connection.
TRANSACTION_*READ_UNCOMMITTEDisolationConnection.TRANSACTION_READ_COMMITTED
valuesConnection.TRANSACTION_REPEATABLE_READ
withortheConnection.TRANSACTION_SERIALIZABLE
.exception(NoteofthatConnection.TRANSACTION_NONE
cannot;some databases maybe used becausenotit specifiessupport otherthat transactionsvaluesare not supported.) @exception SQLException if a database access error occurs or the given parameter is not one of theConnection
constants @see DatabaseMetaData#supportsTransactionIsolationLevel @see #getTransactionIsolation
Installs the givenClass Connection, int TRANSACTION_NONEtypeTypeMap
mapobject as the type map for thisconnectionConnection
object. The type map will be used for the custom mapping of SQL structured types and distinct types. @param map thejava.util.Map
object to install as the replacement for thisConnection
object's default type map @sinceexception1.2SQLException@seeifWhataIs indatabase access error occurs or theJDBCgiven2parameter is not ajava.util.Map
object @since 1.02 @seeAPI#getTypeMap
Class Connection, int TRANSACTION_READ_COMMITTEDIndicatesA constant indicating that transactions are not supported.
Class Connection, int TRANSACTION_READ_UNCOMMITTEDDirtyA constant indicating that dirty reads are prevented; non-repeatable reads and phantom reads can occur. This level only prohibits a transaction from reading a row with uncommitted changes in it.
Class Connection, int TRANSACTION_REPEATABLE_READDirtyA constant indicating that dirty reads non-repeatable reads and phantom reads can occur. This level allows a row changed by one transaction to be read by another transaction before any changes in that row have been committed (a "dirty read"). If any of the changes are rolled back the second transaction will have retrieved an invalid row.
Class Connection, int TRANSACTION_SERIALIZABLEDirtyA constant indicating that dirty reads and non-repeatable reads are prevented; phantom reads can occur. This level prohibits a transaction from reading a row with uncommitted changes in it and it also prohibits the situation where one transaction reads a row a second transaction alters the row and the first transaction rereads the row getting different values the second time (a "non-repeatable read").
DirtyA constant indicating that dirty reads non-repeatable reads and phantom reads are prevented. This level includes the prohibitions inTRANSACTION_REPEATABLE_READ
and further prohibits the situation where one transaction reads all rows that satisfy aWHERE
condition a second transaction inserts a row that satisfies thatWHERE
condition and the first transaction rereads for the same condition retrieving the additional "phantom" row in the second read.
Comprehensive information about the database as a whole.Class DatabaseMetaData, boolean allProceduresAreCallable()
ManyThis interface is implemented by driver vendors to let users know the capabilities of a Database Management System (DBMS) in combination with the driver based on JDBCTM technology ("JDBC driver") that is used with it. Different relational DBMSs often support different features implement features in different ways and use different data types. In addition a driver may implement a feature on top of what the DBMS offers. Information returned by methodsherein this interface applies to the capabilities of a particular driver and a particular DBMS working together. Note that as used in this documentation the term "database" is used generically to refer to both the driver and DBMS.A user for this interface is commonly a tool that needs to discover how to deal with the underlying DBMS. This is especially true for applications that are intended to be used with more than one DBMS. For example a tool might use the method
getTypeInfo
to find out what data types can be used in aCREATE TABLE
statement. Or a user might call the methodsupportsCorrelatedSubqueries
to see if it is possible to use a correlated subquery orsupportsBatchUpdates
to see if it is possible to use batch updates.Some
return lists of information in the form ofDatabaseMetaData
methodsResultSet
objects.YouRegularcan use the normalResultSet
methods such asgetString
andgetInt
can be used to retrieve the data from theseResultSet
objects. If a given form of metadata is not availablethesethemethodsResultSet
shouldgetter methods throw anSQLException
.
SomeofSometheseDatabaseMetaData
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 toanull
that argument'srefcriteriacriterion will be dropped from the search.
AnSQLExceptionAwill be thrownmethod that getsifinformation about a feature that the driver does not supporta meta datawill throw anmethodSQLException
. In the case of methods that return aResultSet
object either aResultSet
object (which may be empty) is returned oraanSQLException
is thrown.
Class DatabaseMetaData, boolean allTablesAreSelectable()Can allRetrieves whether theprocedurescurrentreturned byuser cangetProcedurescall allbethe procedurescalledreturned by thecurrentmethodusergetProcedures
. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean dataDefinitionCausesTransactionCommit()CanRetrieves whether the current user can use all the tables returned bygetTable bethe methodSELECTedgetTables
by thein acurrentSELECT
userstatement. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean dataDefinitionIgnoredInTransactions()DoesRetrieves whether a data definition statement within a transactionforceforces the transaction to commit. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean deletesAreDetected(int)IsRetrieves whether this database ignores a data definition statement within a transactionignored. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean doesMaxRowSizeIncludeBlobs()IndicatesRetrieves whether or not a visible row delete can be detected by calling the methodResultSet.rowDeleted
(). If the methoddeletesAreDetected
()returnsfalse
thenit means that deleted rows are removed from the result set. @paramresult settype theResultSet
type; oneiofResultSet
.eTYPE_FORWARD_ONLYResultSet
.TYPE_SCROLL_INSENSITIVE orResultSet.TYPE_
@returnXXXSCROLL_SENSITIVEtrue
ifchangesdeletes are detected by theresultsetgiven result set type;false
otherwise @exception SQLException if a database access error occurs @since 1.2@see What Is in the JDBC 2.0 API
Class DatabaseMetaData, ResultSet getBestRowIdentifier(String, String, String, int, boolean)DidRetrieves whether the return value for the methodgetMaxRowSize
()includeincludes the SQL data typesLONGVARCHAR and
LONGVARBINARY
. @returnblobstrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, String getCatalogSeparator()GetsRetrieves a description of a table's optimal set of columns that uniquely identifies a row. They are ordered by SCOPE.Each column description has the following columns:
@param catalog a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a catalog;
- 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
null
meansdropthat the catalog namefromshouldthenot be used toselectionnarrowcriteriathe search @param schema a schema name; must match the schema name as it is stored in the database; "" retrieves those without a schema;null
means that the schema name should not be used to narrow the search @param table a table name; must match the table name as it is stored in the database @param scope the scope of interest; use same values as SCOPE @param nullable include columns that are nullable. @returnResultSet
- each row is a column description @exception SQLException if a database access error occurs
Class DatabaseMetaData, String getCatalogTerm()What'sRetrieves theString
that this database uses as the separator between a catalog and table name. @return the separator string @exception SQLException if a database access error occurs
Class DatabaseMetaData, ResultSet getCatalogs()What'sRetrieves the database vendor's preferred term for "catalog". @return the vendor term for "catalog" @exception SQLException if a database access error occurs
Class DatabaseMetaData, ResultSet getColumnPrivileges(String, String, String, String)GetsRetrieves the catalog names available in this database. The results are ordered by catalog name.The catalog column is:
@return a
- TABLE_CAT String => catalog name
ResultSet
-object in which each row has a singleString
column that is a catalog name @exception SQLException if a database access error occurs
Class DatabaseMetaData, ResultSet getColumns(String, String, String, String)GetsRetrieves a description of the access rights for a table's columns.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; must match the catalog name as it is stored in the database; "" retrieves those without a catalog;
- 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 unknownnull
meansdropthat the catalog namefrom the selectionshould not becriteriaused to narrow the search @param schema a schema name; must match the schema name as it is stored in the database; "" retrieves those without a schema;null
means that the schema name should not be used to narrow the search @param table a table name; must match the table name as it is stored in the database @param columnNamePattern a column name pattern; must match the column name as it is stored in the database @returnResultSet
- each row is a column privilege description @exception SQLException if a database access error occurs @see #getSearchStringEscape
Class DatabaseMetaData, Connection getConnection()GetsRetrieves a description of table columns available in the specified catalog.Only column descriptions matching the catalog schema table and column name criteria are returned. They are ordered by
TABLE_SCHEM
TABLE_NAME
andORDINAL_POSITION
.Each column description has the following columns:
@param catalog a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a catalog;
- 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.
- SCOPE_CATLOG String => catalog of table that is the scope of a reference attribute (
null
if DATA_TYPE isn't REF)- SCOPE_SCHEMA String => schema of table that is the scope of a reference attribute (
null
if the DATA_TYPE isn't REF)- SCOPE_TABLE String => table name that this the scope of a reference attribure (
null
if the DATA_TYPE isn't REF)- SOURCE_DATA_TYPE short => source type of a distinct type or user-generated Ref type SQL type from java.sql.Types (
null
if DATA_TYPE isn't DISTINCT or user-generated REF)null
meansdropthat the catalog namefrom the selectionshould not becriteriaused to narrow the search @param schemaPattern a schema name pattern; must match the schema name as it is stored in the database; "" retrieves those without a schema;null
means that the schema name should not be used to narrow the search @param tableNamePattern a table name pattern; must match the table name as it is stored in the database @param columnNamePattern a column name pattern; must match the column name as it is stored in the database @returnResultSet
- each row is a column description @exception SQLException if a database access error occurs @see #getSearchStringEscape
Retrieves the connection that produced this metadata object.Class DatabaseMetaData, ResultSet getCrossReference(String, String, String, String, String, String)@return the connection that produced this metadata object @
sinceexception1.2SQLException@seeifWhataIs in the JDBCdatabase access error occurs2.0@sinceAPI1.2
Class DatabaseMetaData, String getDatabaseProductName()GetsRetrieves a description of the foreign key columns in the given foreign key table that reference the primary key columns of the given primary key table (describe how one table imports another's key.). This should normally return a single foreign key/primary key pair(because most tablesonlyimport a foreign key from a table only once.)They are ordered by FKTABLE_CAT FKTABLE_SCHEM FKTABLE_NAME and KEY_SEQ.Each foreign key column description has the following columns:
@param primaryCatalog a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a catalog;
- 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 benull
)- FKTABLE_SCHEM String => foreign key table schema (may be
null
) being exported (may benull
)- 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
null
means drop catalog name from the selection criteria @param primarySchema a schema name; must match the schema name as it is stored in the database; "" retrieves those without a schema;null
means drop schema name from the selection criteria @param primaryTable thetablename of the table that exports the key; must match the table name as it is stored in the database @param foreignCatalog a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a catalog;null
means drop catalog name from the selection criteria @param foreignSchema a schema name; must match the schema name as it is stored in the database; "" retrieves those without a schema;null
means drop schema name from the selection criteria @param foreignTable thetablename of the table that imports the key; must match the table name as it is stored in the database @returnResultSet
- each row is a foreign key column description @exception SQLException if a database access error occurs @see #getImportedKeys
Class DatabaseMetaData, String getDatabaseProductVersion()What'sRetrieves the name of this database product. @return database product name @exception SQLException if a database access error occurs
Class DatabaseMetaData, int getDefaultTransactionIsolation()What'sRetrieves the version number of this database product. @return database version number @exception SQLException if a database access error occurs
Class DatabaseMetaData, int getDriverMajorVersion()What'sRetrievesthethis database's default transaction isolation level. The possible values are defined injava.sql.Connection
. @return the default isolation level @exception SQLException if a database access error occurs @see Connection
Class DatabaseMetaData, int getDriverMinorVersion()What'sRetrieves this JDBC driver's major version number. @return JDBC driver major version
Class DatabaseMetaData, String getDriverName()What'sRetrieves this JDBC driver's minor version number. @return JDBC driver minor version number
Class DatabaseMetaData, String getDriverVersion()What'sRetrieves the name of this JDBC driver. @return JDBC driver name @exception SQLException if a database access error occurs
Class DatabaseMetaData, ResultSet getExportedKeys(String, String, String)What'sRetrieves the version number of this JDBC driver as aString
. @return JDBC driver version @exception SQLException if a database access error occurs
Class DatabaseMetaData, String getExtraNameCharacters()GetsRetrieves a description of the foreign key columns that referenceathe given 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.Each foreign key column description has the following columns:
@param catalog a catalog name; must match the catalog name as it is stored in this database; "" retrieves those without a catalog;
- 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 benull
)- FKTABLE_SCHEM String => foreign key table schema (may be
null
) being exported (may benull
)- 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
null
meansdropthat the catalog namefromshouldthenot be usedselectionto narrow thecriteriasearch @param schema a schema name; must match the schema name as it is stored in the database; "" retrieves those without a schema;null
means that the schema name should not be used to narrow the search @param table a table name; must match the table name as it is stored in this database @return aResultSet
-object in which each row is a foreign key column description @exception SQLException if a database access error occurs @see #getImportedKeys
Class DatabaseMetaData, String getIdentifierQuoteString()GetsRetrieves all the "extra" characters that can be used in unquoted identifier names (those beyond a-z A-Z 0-9 and _). @return the string containing the extra characters @exception SQLException if a database access error occurs
Class DatabaseMetaData, ResultSet getImportedKeys(String, String, String)What'sRetrieves the string used to quote SQL identifiers. This method returns a space " " if identifier quotingisn'tis not supported.A JDBC@returnCompliantTMthedriver always usesquoting string or adouble quotespacecharacter.if@returnquotingthe quoting stringis not supported @exception SQLException if a database access error occurs
Class DatabaseMetaData, ResultSet getIndexInfo(String, String, String, boolean, boolean)GetsRetrieves 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.Each primary key column description has the following columns:
@param catalog a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a catalog;
- 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 a foreign key
- UPDATE_RULE short => What happens to a foreign key when the primary key 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
null
meansdropthat the catalog namefromshouldthenot be used to narrowselection criteriathe search @param schema a schema name; must match the schema name as it is stored in the database; "" retrieves those without a schema;null
means that the schema name should not be used to narrow the search @param table a table name; must match the table name as it is stored in the database @returnResultSet
- each row is a primary key column description @exception SQLException if a database access error occurs @see #getExportedKeys
Class DatabaseMetaData, int getMaxBinaryLiteralLength()GetsRetrieves a description ofathe given table's indices and statistics. They are ordered by NON_UNIQUE TYPE INDEX_NAME and ORDINAL_POSITION.Each index column description has the following columns:
@param catalog a catalog name; must match the catalog name as it is stored in this database; "" retrieves those without a catalog;
- 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
)null
meansdropthat the catalog namefromshouldthenot be used toselectionnarrowcriteriathe search @param schema a schema name; must match the schema name as it is stored in this database; "" retrieves those without a schema;null
means that the schema name should not be used to narrow the search @param table a table name; must match the table name as it is stored in this database @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 @returnResultSet
- each row is an index column description @exception SQLException if a database access error occurs
Class DatabaseMetaData, int getMaxCatalogNameLength()HowRetrievesmanythe maximum number of hex characterscan you havethis database allows in an inline binary literal. @return maxbinary literalthe maximum length (in hex characters) for a binary literal; a result of zero means that there is no limit or the limit is not known @exception SQLException if a database access error occurs
Class DatabaseMetaData, int getMaxCharLiteralLength()What'sRetrieves the maximumlengthnumber of characters that this database allows in a catalog name. @returnmaxthenamemaximum number of characterslengthallowed inbytesa catalog name; a result of zero means that there is no limit or the limit is not known @exception SQLException if a database access error occurs
Class DatabaseMetaData, int getMaxColumnNameLength()What'sRetrieves themax lengthmaximum number of characters this database allows for a character literal. @returnmaxtheliteralmaximum number of characters allowed forlengtha character literal; a result of zero means that there is no limit or the limit is not known @exception SQLException if a database access error occurs
Class DatabaseMetaData, int getMaxColumnsInGroupBy()What'sRetrieves thelimitmaximum number of characters thisondatabase allows for a column namelength. @returnmaxthe maximum number of characters allowed for a column namelength; a result of zero means that there is no limit or the limit is not known @exception SQLException if a database access error occurs
Class DatabaseMetaData, int getMaxColumnsInIndex()What'sRetrieves the maximum number of columns this database allows in a"GROUP BY
clause. @return"maxthe maximum number of columns allowed; a result of zero means that there is no limit or the limit is not known @exception SQLException if a database access error occurs
Class DatabaseMetaData, int getMaxColumnsInOrderBy()What'sRetrieves the maximum number of columnsallowedthis database allows in an index. @returnmaxthe maximum number of columns allowed; a result of zero means that there is no limit or the limit is not known @exception SQLException if a database access error occurs
Class DatabaseMetaData, int getMaxColumnsInSelect()What'sRetrieves the maximum number of columns this database allows in an"ORDER BY
clause. @return"maxthe maximum number of columns allowed; a result of zero means that there is no limit or the limit is not known @exception SQLException if a database access error occurs
Class DatabaseMetaData, int getMaxColumnsInTable()What'sRetrieves the maximum number of columns this database allows in a"SELECT
list. @return"maxthe maximum number of columns allowed; a result of zero means that there is no limit or the limit is not known @exception SQLException if a database access error occurs
Class DatabaseMetaData, int getMaxConnections()What'sRetrieves the maximum number of columns this database allows in a table. @returnmaxthe maximum number of columns allowed; a result of zero means that there is no limit or the limit is not known @exception SQLException if a database access error occurs
Class DatabaseMetaData, int getMaxCursorNameLength()HowRetrievesmany active connections canthewe have at a timemaximum number of concurrent connections to this database that are possible. @returnmaxthe maximum number of active connections possible at one time; a result of zero means that there is no limit or the limit is not known @exception SQLException if a database access error occurs
Class DatabaseMetaData, int getMaxIndexLength()What'sRetrieves the maximum number of characters that this database allows in a cursor name.length@returnmax cursorthe maximumnamenumber oflengthcharacters allowed inbytesa cursor name; a result of zero means that there is no limit or the limit is not known @exception SQLException if a database access error occurs
Retrieves the maximum number of bytes this database allows for an index including all of the parts of the index. @returnClass DatabaseMetaData, int getMaxProcedureNameLength()max index length inthe maximum number of byteswhichallowed; this limit 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
Class DatabaseMetaData, int getMaxRowSize()What'sRetrieves the maximumlengthnumber of characters that this database allows in a procedure name. @returnmaxthenamemaximum number of characterslengthallowed inbytesa procedure name; a result of zero means that there is no limit or the limit is not known @exception SQLException if a database access error occurs
Class DatabaseMetaData, int getMaxSchemaNameLength()What'sRetrieves the maximumlengthnumber of bytes this database allows in a single row. @returnmax row size inthe maximum number of bytes allowed for a row; a result of zero means that there is no limit or the limit is not known @exception SQLException if a database access error occurs
Class DatabaseMetaData, int getMaxStatementLength()What'sRetrieves the maximumlengthnumberallowedof characters that thisfordatabase allows in a schema name. @returnmaxthenamemaximum number of characterslengthallowed inbytesa schema name; a result of zero means that there is no limit or the limit is not known @exception SQLException if a database access error occurs
Class DatabaseMetaData, int getMaxStatements()What'sRetrieves the maximumlengthnumber of characters this database allows in an SQL statement. @returnmax length inthe maximum numberbytesof characters allowed for an SQL statement; a result of zero means that there is no limit or the limit is not known @exception SQLException if a database access error occurs
Class DatabaseMetaData, int getMaxTableNameLength()HowRetrievesmanythe maximum number of active statementscan we have open at one time to thisto this database that can be open at thedatabasesame time. @return the maximum number of statements that can be open at one time; a result of zero means that there is no limit or the limit is not known @exception SQLException if a database access error occurs
Class DatabaseMetaData, int getMaxTablesInSelect()What'sRetrieves the maximumlengthnumber of characters this database allows in a table name. @returnmax name lengththe maximum numberinof characters allowed forbytesa table name; a result of zero means that there is no limit or the limit is not known @exception SQLException if a database access error occurs
Class DatabaseMetaData, int getMaxUserNameLength()What'sRetrieves the maximum number of tables this database allows in aSELECT
statement. @return the maximum number of tables allowed in aSELECT
statement; a result of zero means that there is no limit or the limit is not known @exception SQLException if a database access error occurs
Class DatabaseMetaData, String getNumericFunctions()What'sRetrieves the maximumlengthnumber of characters this database allows in a user name. @returnmax user name lengththe maximum number ofincharacters allowed forbytesa user name; a result of zero means that there is no limit or the limit is not known @exception SQLException if a database access error occurs
Class DatabaseMetaData, ResultSet getPrimaryKeys(String, String, String)GetsRetrieves a comma-separated list of math functions available with this database. These are theXOpen /Open CLI math function names used in the JDBC function escape clause. @return the list of math functions supported by this database @exception SQLException if a database access error occurs
Class DatabaseMetaData, ResultSet getProcedureColumns(String, String, String, String)GetsRetrieves a description ofathe given table's primary key columns. They are ordered by COLUMN_NAME.Each primary key column description has the following columns:
@param catalog a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a catalog;
- 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
)null
meansdropthat the catalog namefrom theshould notselectionbe used to narrow thecriteriasearch @param schema a schema name; must match the schema name as it is stored in the database; "" retrieves those without a schema;null
means that the schema name should not be used to narrow the search @param table a table name; must match the table name as it is stored in the database @returnResultSet
- each row is a primary key column description @exception SQLException if a database access error occurs
Class DatabaseMetaData, String getProcedureTerm()GetsRetrieves a description ofathe given catalog's stored procedureparametersparameter and result columns.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
ResultSet
is 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; must match the catalog name as it is stored in the database; "" retrieves those without a catalog;
null
meansdropthat the catalog namefromshouldthenot beselectionusedcriteriato narrow the search @param schemaPattern a schema name pattern; must match the schema name as it is stored in the database; "" retrieves those without a schema;null
means that the schema name should not be used to narrow the search @param procedureNamePattern a procedure name pattern; must match the procedure name as it is stored in the database @param columnNamePattern a column name pattern; must match the column name as it is stored in the database @returnResultSet
- each row describes a stored procedure parameter or column @exception SQLException if a database access error occurs @see #getSearchStringEscape
Class DatabaseMetaData, ResultSet getProcedures(String, String, String)What'sRetrieves the database vendor's preferred term for "procedure". @return the vendor term for "procedure" @exception SQLException if a database access error occurs
Class DatabaseMetaData, String getSQLKeywords()GetsRetrieves a description of the stored procedures available inathe given catalog.Only procedure descriptions matching the schema and procedure name criteria are returned. They are ordered by
PROCEDURE_SCHEM
andPROCEDURE_NAME
.Each procedure description has the the following columns:
@param catalog a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a catalog;
- 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
null
meansdropthat the catalog namefromshouldthenot beselectionusedcriteriato narrow the search @param schemaPattern a schema name pattern; must match the schema name as it is stored in the database; "" retrieves those without a schema;null
means that the schema name should not be used to narrow the search @param procedureNamePattern a procedure name pattern; must match the procedure name as it is stored in the database @returnResultSet
- each row is a procedure description @exception SQLException if a database access error occurs @see #getSearchStringEscape
Class DatabaseMetaData, String getSchemaTerm()GetsRetrieves a comma-separated list of allaof this database's SQL keywords that are NOT also SQL92 keywords. @return the list of this database's keywords that are not also SQL92 keywords @exception SQLException if a database access error occurs
Class DatabaseMetaData, ResultSet getSchemas()What'sRetrieves the database vendor's preferred term for "schema". @return the vendor term for "schema" @exception SQLException if a database access error occurs
Class DatabaseMetaData, String getSearchStringEscape()GetsRetrieves the schema names available in this database. The results are ordered by schema name.The schema column is:
- TABLE_SCHEM String => schema name
- TABLE_CATALOG
@returnString => catalog name (may be)
ResultSetnull-each@returnrowahasResultSet
a single String column thatobject in which each row is a schemanamedecription @exception SQLException if a database access error occurs
Class DatabaseMetaData, String getStringFunctions()GetsRetrieves the string that can be used to escape wildcard characters. This is the string that can be used to escape '_' or '%' in thestringcatalog search parameters that are a patternstyle(andcatalog searchtherefore useparametersone of the wildcard characters).The '_' character represents any single character
.;Thethe '%' character represents any sequence of zero or more characters. @return the string used to escape wildcard characters @exception SQLException if a database access error occurs
Class DatabaseMetaData, String getSystemFunctions()GetsRetrieves a comma-separated list of string functions available with this database. These are theX/Open Group CLI string function names used in the JDBC function escape clause. @return the list of string functions supported by this database @exception SQLException if a database access error occurs
Class DatabaseMetaData, ResultSet getTablePrivileges(String, String, String)GetsRetrieves a comma-separated list of system functions available with this database. These are theX/Open Group CLI system function names used in the JDBC function escape clause. @returnthea list of system functions supported by this database @exception SQLException if a database access error occurs
Class DatabaseMetaData, ResultSet getTableTypes()GetsRetrieves 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 thispriviledgeprivilege applies to all columns (this may be true for some systems but is not true for all.)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; must match the catalog name as it is stored in the database; "" retrieves those without a catalog;
- 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 unknownnull
meansdropthat the catalog namefromshouldthenot beselectionusedcriteriato narrow the search @param schemaPattern a schema name pattern; must match the schema name as it is stored in the database; "" retrieves those without a schema;null
means that the schema name should not be used to narrow the search @param tableNamePattern a table name pattern; must match the table name as it is stored in the database @returnResultSet
- each row is a table privilege description @exception SQLException if a database access error occurs @see #getSearchStringEscape
Class DatabaseMetaData, ResultSet getTables(String, String, String, String[])GetsRetrieves the table types available in this database. The results are ordered by table type.The table type is:
@return a
- TABLE_TYPE String => table type. Typical types are "TABLE" "VIEW" "SYSTEM TABLE" "GLOBAL TEMPORARY" "LOCAL TEMPORARY" "ALIAS" "SYNONYM".
ResultSet
-object in which each row has a singleString
column that is a table type @exception SQLException if a database access error occurs
Class DatabaseMetaData, String getTimeDateFunctions()GetsRetrieves a description of the tables available inathe given catalog. 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
- TYPE_CAT String => the types catalog (may be
null
)- TYPE_SCHEM String => the types schema (may be
null
)- TYPE_NAME String => type name (may be
null
)- SELF_REFERENCING_COL_NAME String => name of the designated "identifier" column of a typed table (may be
null
)- REF_GENERATION String => specifies how values in SELF_REFERENCING_COL_NAME are created. Values are "SYSTEM" "USER" "DERIVED". (may be
null
)Note: Some databases may not return information for all tables. @param catalog a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a catalog;
null
meansdropthat the catalog namefromshouldthenot beselectionusedcriteriato narrow the search @param schemaPattern a schema name pattern; must match the schema name as it is stored in the database; "" retrieves those without a schema;null
means that the schema name should not be used to narrow the search @param tableNamePattern a table name pattern; must match the table name as it is stored in the database @param types a list of table types to include;null
returns all types @returnResultSet
- each row is a table description @exception SQLException if a database access error occurs @see #getSearchStringEscape
Class DatabaseMetaData, ResultSet getTypeInfo()GetsRetrieves a comma-separated list of the time and date functions available with this database. @return the list of time and date functions supported by this database @exception SQLException if a database access error occurs
Class DatabaseMetaData, ResultSet getUDTs(String, String, String, int[])GetsRetrieves 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.Each type description has the following columns:
@return a
- 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
-object in which each row is an SQL type description @exception SQLException if a database access error occurs
Class DatabaseMetaData, String getURL()GetsRetrieves a description of the user-defined types (UDTs) defined in a particular schema. Schema-specific UDTs may have typeJAVA_OBJECT
STRUCT
orDISTINCT
.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
- BASE_TYPE short => type code of the source type of a DISTINCT type or the type that implements the user-generated reference type of the SELF_REFERENCING_COLUMN of a structured type as defined in java.sql.Types (
null
if DATA_TYPE is not DISTINCT or not STRUCT with REFERENCE_GENERATION = USER_DEFINED)Note: If the driver does not support UDTs an empty result set is returned. @param catalog a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a catalog;
null
meansdropthat the catalog namefromshouldthenot beselectionusedcriteriato narrow the search @param schemaPattern a schema pattern name;patternmust match the schema name as it is stored in the database; "" retrieves those without a schema;null
means that the schema name should not be used to narrow the search @param typeNamePattern a type name pattern; must match the type name as it is stored in the database; may be a fully-qualified name @param types a list of user-nameddefined typesto include(JAVA_OBJECT STRUCT or DISTINCT) to include;null
returns all types @returnResultSet
-object in which each rowisdescribes atype descriptionUDT @exception SQLException if a database access error occurs @since 1.2@see What Is in the JDBC 2.0 API
Class DatabaseMetaData, String getUserName()What'sRetrieves theurlURL for thisdatabaseDBMS. @return theurlURL for this DBMS ornull
if it cannot be generated @exception SQLException if a database access error occurs
Class DatabaseMetaData, ResultSet getVersionColumns(String, String, String)What'sRetrievesourthe user name as known tothethis database. @returnourthe database user name @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean insertsAreDetected(int)GetsRetrieves a description of a table's columns that are automatically updated when any value in a row is updated. They are unordered.Each column description has the following columns:
@param catalog a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a catalog;
- 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 =>
iswhether thisais 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
null
meansdropthat the catalog namefromshouldthenot beselectionused to narrow thecriteriasearch @param schema a schema name; must match the schema name as it is stored in the database; "" retrieves those without a schema;null
means that the schema name should not be used to narrow the search @param table a table name; must match the table name as it is stored in the database @return aResultSet
-object in which each row is a column description @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean isCatalogAtStart()IndicatesRetrieves whether or not a visible row insert can be detected by calling the methodResultSet.rowInserted
(). @paramresulttypesettheResultSet
type; one ofiResultSet.
eTYPE_FORWARD_ONLYResultSet.TYPE_SCROLL_INSENSITIVE
orResultSet.TYPE_
@returnXXXSCROLL_SENSITIVEtrue
if changes are detected by theresultsetspecified result set type;false
otherwise @exception SQLException if a database access error occurs @since 1.2@see What Is in the JDBC 2.0 API
Class DatabaseMetaData, boolean isReadOnly()DoesRetrieves whether a catalogappearappears at the start of a fully qualified table name. If(Otherwisenotitthe catalog appears at the end). @returntrue
ifitthe catalog name appears at thestartbeginning of a fully qualified table name;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean nullPlusNonNullIsNull()Is theRetrieves whether this database is in read-only mode. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean nullsAreSortedAtEnd()AreRetrieves whether this database supports concatenations betweenNULL
and non-NULL
valuesNULL For SQL-92 compliance a JDBC technology-enabled driver will returnbeing. @return
trueNULLtrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean nullsAreSortedAtStart()AreRetrieves whetherNULL values are sorted at the end regardless of sort order. @return
true
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean nullsAreSortedHigh()AreRetrieves whetherNULL values are sorted at the start regardless of sort order. @return
true
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean nullsAreSortedLow()AreRetrieves whetherNULL values are sorted high. Sorted high means that
NULL
values sort higher than any other value in a domain. In an ascending order if this method returnstrue
NULL
values will appear at the end. By contrast the methodnullsAreSortedAtEnd
indicates whetherNULL
values are sorted at the end regardless of sort order. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean othersDeletesAreVisible(int)AreRetrieves whetherNULL values are sorted low. Sorted low means that
NULL
values sort lower than any other value in a domain. In an ascending order if this method returnstrue
NULL
values will appear at the beginning. By contrast the methodnullsAreSortedAtStart
indicates whetherNULL
values are sorted at the beginning regardless of sort order. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean othersInsertsAreVisible(int)IndicatesRetrieves whether deletes made by others are visible. @paramresulttypesettheResultSet
type; one ofiResultSet.
eTYPE_FORWARD_ONLYResultSet.TYPE_SCROLL_INSENSITIVE
orResultSet.TYPE_
XXXSCROLL_SENSITIVE @returntrue
if deletes made by others are visible for the given result set type;false
otherwise @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)IndicatesRetrieves whether inserts made by others are visible. @paramresulttypesettheResultSet
type;i.e.one ofResultSet.TYPE_
XXX @return true if updates are visible for theFORWARD_ONLYresultResultSet.TYPE_SCROLL_INSENSITIVE
setortypeResultSet.TYPE_SCROLL_SENSITIVE
@returntrue
if inserts made by others are visible for the given result set type;false
otherwise @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)IndicatesRetrieves whether updates made by others are visible. @paramresulttypesettheResultSet
type; one ofiResultSet.
eTYPE_FORWARD_ONLYResultSet.TYPE_SCROLL_INSENSITIVE
orResultSet.TYPE_
XXXSCROLL_SENSITIVE @returntrue
if updates made by others are visible for the given result set type;false
otherwise @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)IndicatesRetrieves whether a result set's own deletes are visible. @paramresulttypesettheResultSet
type; one ofiResultSet.
eTYPE_FORWARD_ONLYResultSet.TYPE_SCROLL_INSENSITIVE
orResultSet.TYPE_
XXXSCROLL_SENSITIVE @returntrue
if deletes are visible for the given result set type;false
otherwise @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)IndicatesRetrieves whether a result set's own inserts are visible. @paramresulttypesettheResultSet
type; one ofiResultSet.
eTYPE_FORWARD_ONLYResultSet.TYPE_SCROLL_INSENSITIVE
orResultSet.TYPE_
XXXSCROLL_SENSITIVE @returntrue
if inserts are visible for the given result set type;false
otherwise @exception SQLException if a database access error occurs @since 1.2@see What Is in the JDBC 2.0 API
Class DatabaseMetaData, boolean storesLowerCaseIdentifiers()IndicatesRetrieves whetherafor the given type ofResultSet
object the result set's own updates are visible. @paramresulttypesettheResultSet
type; oneiofResultSet
.eTYPE_FORWARD_ONLYResultSet
.TYPE_SCROLL_INSENSITIVE orResultSet.TYPE_
XXXSCROLL_SENSITIVE @returntrue
if updates are visible for the given result set type;false
otherwise @exception SQLException if a database access error occurs @since 1.2@see What Is in the JDBC 2.0 API
Class DatabaseMetaData, boolean storesLowerCaseQuotedIdentifiers()Does theRetrieves whether this databasetreattreats mixed case unquoted SQL identifiers as case insensitive andstorestores them in lower case. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean storesMixedCaseIdentifiers()Does theRetrieves whether this databasetreattreats mixed case quoted SQL identifiers as case insensitive andstorestores them in lower case. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean storesMixedCaseQuotedIdentifiers()Does theRetrieves whether this databasetreattreats mixed case unquoted SQL identifiers as case insensitive andstorestores them in mixed case. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean storesUpperCaseIdentifiers()Does theRetrieves whether this databasetreattreats mixed case quoted SQL identifiers as case insensitive andstorestores them in mixed case. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean storesUpperCaseQuotedIdentifiers()Does theRetrieves whether this databasetreattreats mixed case unquoted SQL identifiers as case insensitive andstorestores them in upper case. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsANSI92EntryLevelSQL()Does theRetrieves whether this databasetreattreats mixed case quoted SQL identifiers as case insensitive andstorestores them in upper case. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsANSI92FullSQL()IsRetrieves whether this database supports the ANSI92 entry level SQL grammarsupported All JDBC CompliantTM drivers must return true. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsANSI92IntermediateSQL()IsRetrieves whether this database supports the ANSI92 full SQL grammar supported. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsAlterTableWithAddColumn()IsRetrieves whether this database supports the ANSI92 intermediate SQL grammar supported. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsAlterTableWithDropColumn()IsRetrieves"whether this database supportsALTER TABLE
"with add columnsupported. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsBatchUpdates()IsRetrieves"whether this database supportsALTER TABLE
"with drop columnsupported. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsCatalogsInDataManipulation()IndicatesRetrieves whetherthethisdriverdatabase supports batch updates. @returntrue
ifthe driverthis database supports batchupdatesupcates;false
otherwise @sinceexception1.2SQLException@seeifWhataIs in the JDBCdatabase access error occurs2.0@sinceAPI1.2
Class DatabaseMetaData, boolean supportsCatalogsInIndexDefinitions()CanRetrieves whether a catalog name can be used in a data manipulation statement. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsCatalogsInPrivilegeDefinitions()CanRetrieves whether a catalog name can be used in an index definition statement. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsCatalogsInProcedureCalls()CanRetrieves whether a catalog name can be used in a privilege definition statement. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsCatalogsInTableDefinitions()CanRetrieves whether a catalog name can be used in a procedure call statement. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsColumnAliasing()CanRetrieves whether a catalog name can be used in a table definition statement. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsConvert()IsRetrieves whether this database supports column aliasingsupported.If so the SQL AS clause can be used to provide names for computed columns or to provide alias names for columns as required.
A JDBC CompliantTM driver always returns true.@returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsConvert(int, int)IsRetrieves whether this database supports theCONVERT
function between SQL typessupported. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsCoreSQLGrammar()IsRetrievesCONVERTwhether this databasebetweensupports theCONVERT
for two given SQL typessupported. @param fromType the type to convert from; one of the type codes from the classjava.sql.Types
@param toType the type to convert to; one of the type codes from the classjava.sql.Types
@returntrue
if so;false
otherwise @exception SQLException if a database access error occurs @see Types
Class DatabaseMetaData, boolean supportsCorrelatedSubqueries()IsRetrieves whether this database supports the ODBC Core SQL grammarsupported. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsDataDefinitionAndDataManipulationTransactions()AreRetrievescorrelated subqueries supported AwhetherJDBCthisCompliantTM driverdatabasealways returns truesupports correlated subqueries. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsDataManipulationTransactionsOnly()AreRetrieves whether this database supports both data definition and data manipulation statements within a transactionsupported. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsDifferentTableCorrelationNames()AreRetrieves whether this database supports only data manipulation statements within a transactionsupported. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsExpressionsInOrderBy()IfRetrieves whether when table correlation names are supportedarethey are restricted tobebeing different from the names of the tables. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsExtendedSQLGrammar()AreRetrieves whether this database supports expressions in"ORDER BY
lists"supported. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsFullOuterJoins()IsRetrieves whether this database supports the ODBC Extended SQL grammarsupported. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsGroupBy()AreRetrieves whether this database supports full nested outer joinssupported. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsGroupByBeyondSelect()IsRetrieves whether this database supports some form of"GROUP BY
clause"supported. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsGroupByUnrelated()Can aRetrieves whether"GROUPthisBY"databaseclause addsupports using columns not included in theSELECT
providedstatement in aGROUP BY
clauseit specifiesprovided that all of the columns in theSELECT
statement are included in theGROUP BY
clause. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsIntegrityEnhancementFacility()Can aRetrieves whether"GROUPthisBY"databaseclausesupports usingusea column thatcolumnsis not in theSELECT
statement in aGROUP BY
clause. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsLikeEscapeClause()IsRetrieves whether this database supports the SQL Integrity Enhancement Facilitysupported. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsLimitedOuterJoins()Is theRetrieves whetherescape character in "LIKE" clauses supportedthisA JDBCdatabase supportsCompliantTMspecifyingdriveraalwaysLIKE
returns trueescape clause. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsMinimumSQLGrammar()Is thereRetrieves whether this database provides limited support for outer joins. (This will betrue
ifsupportFullOuterJoinsthe methodissupportsFullOuterJoins
returnstrue
.). @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsMixedCaseIdentifiers()IsRetrieves whether this database supports the ODBC Minimum SQL grammarsupported All JDBC CompliantTM drivers must return true. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsMixedCaseQuotedIdentifiers()Does theRetrieves whether this databasetreattreats mixed case unquoted SQL identifiers as case sensitive and as a resultstorestores them in mixed caseA JDBC CompliantTM driver will always return false. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsMultipleResultSets()Does theRetrieves whether this databasetreattreats mixed case quoted SQL identifiers as case sensitive and as a resultstorestores them in mixed caseA JDBC CompliantTM driver will always return true. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsMultipleTransactions()AreRetrieves whether this database supports getting multipleResultSet
objects from a singleexecutecall to the methodsupportedexecute
. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsNonNullableColumns()Can we haveRetrieves whether this database allows having multiple transactions open at once (on different connections). @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsOpenCursorsAcrossCommit()CanRetrieves whether columns in this database may be defined as non-nullableA JDBC CompliantTM driver always returns true. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsOpenCursorsAcrossRollback()Can cursorsRetrieves whetherremainthis database supports keeping cursors open across commits. @returntrue
if cursors always remain open;false
if they might not remain open @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsOpenStatementsAcrossCommit()Can cursorsRetrieves whetherremainthis database supports keeping cursors open across rollbacks. @returntrue
if cursors always remain open;false
if they might not remain open @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsOpenStatementsAcrossRollback()Can statementsRetrieves whetherremainthis database supports keeping statements open across commits. @returntrue
if statements always remain open;false
if they might not remain open @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsOrderByUnrelated()Can statementsRetrieves whetherremainthis database supports keeping statements open across rollbacks. @returntrue
if statements always remain open;false
if they might not remain open @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsOuterJoins()Can anRetrieves whether"ORDERthisBY"databaseclausesupports usingusea column thatcolumnsis not in theSELECT
statement in anORDER BY
clause. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsPositionedDelete()IsRetrieves whether this database supports some form of outer joinsupported. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsPositionedUpdate()IsRetrieves whether this database supports positionedDELETE
supportedstatements. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsResultSetConcurrency(int, int)IsRetrieves whether this database supports positionedUPDATE
supportedstatements. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsResultSetType(int)DoesRetrievesthewhether this databasesupportsupports the given concurrency type in combination with the given result set type. @param type defined injava.sql.ResultSet
@param concurrency type defined injava.sql.ResultSet
@returntrue
if so;false
otherwise @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 supportsSchemasInDataManipulation()DoesRetrievesthewhether this databasesupportsupports the given result set type. @param type defined injava.sql.ResultSet
@returntrue
if so;false
otherwise @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 supportsSchemasInIndexDefinitions()CanRetrieves whether a schema name can be used in a data manipulation statement. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsSchemasInPrivilegeDefinitions()CanRetrieves whether a schema name can be used in an index definition statement. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsSchemasInProcedureCalls()CanRetrieves whether a schema name can be used in a privilege definition statement. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsSchemasInTableDefinitions()CanRetrieves whether a schema name can be used in a procedure call statement. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsSelectForUpdate()CanRetrieves whether a schema name can be used in a table definition statement. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsStoredProcedures()IsRetrieves whether this database supportsSELECT
forFOR UPDATEsupportedstatements. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsSubqueriesInComparisons()AreRetrieves whether this database supports stored procedure callsusingthat use the stored procedure escape syntaxsupported. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsSubqueriesInExists()AreRetrievessubqueries in comparison expressionswhethersupportedthisA JDBCdatabaseCompliantTMsupportsdriver always returns truesubqueries in comparison expressions. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsSubqueriesInIns()AreRetrievessubqueries in 'exists' expressions supportedwhetherA JDBCthis databaseCompliantTMsupportsdriver alwayssubqueries inreturnsEXISTS
trueexpressions. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsSubqueriesInQuantifieds()AreRetrievessubqueries in 'in' statements supportedwhetherA JDBCthis databaseCompliantTMsupportsdriver alwayssubqueries inreturnsIN
truestatements. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsTableCorrelationNames()AreRetrievessubqueries in quantified expressionswhethersupportedthisA JDBCdatabaseCompliantTMsupportsdriver always returns truesubqueries in quantified expressions. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsTransactionIsolationLevel(int)AreRetrievestable correlation names supportedwhetherAthisJDBC CompliantTMdatabasedriver always returns truesupports table correlation names. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsTransactions()DoesRetrieves whether this databasesupportsupports the given transaction isolation level. @param level one of thevaluestransaction isolationarelevels defined injava.sql.Connection
@returntrue
if so;false
otherwise @exception SQLException if a database access error occurs @see Connection
Class DatabaseMetaData, boolean supportsUnion()Are transactionsRetrieves whethersupportedthis database supports transactions. If not invoking the methodcommit
is a noop and the isolation level isTRANSACTION_NONE
. @returntrue
if transactions are supported;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean supportsUnionAll()IsRetrieves whether this database supports SQLUNION
. @returnsupportedtrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean updatesAreDetected(int)IsRetrieves whether this database supports SQLUNION ALL
. @returnsupportedtrue
if so;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, boolean usesLocalFilePerTable()IndicatesRetrieves whether or not a visible row update can be detected by calling the methodResultSet.rowUpdated
. @paramresulttypesettheResultSet
type; one ofiResultSet.
eTYPE_FORWARD_ONLYResultSet.TYPE_SCROLL_INSENSITIVE
orResultSet.TYPE_
@returnXXXSCROLL_SENSITIVEtrue
if changes are detected by the result set type;false
otherwise @exception SQLException if a database access error occurs @since 1.2@see What Is in the JDBC 2.0 API
Class DatabaseMetaData, boolean usesLocalFiles()Does theRetrieves whether this databaseuseuses a file for each table. @returntrue
ifthethis database uses a local file for each table;false
otherwise @exception SQLException if a database access error occurs
Class DatabaseMetaData, int bestRowNotPseudoDoes theRetrieves whether this databasestorestores tables in a local file. @returntrue
if so;false
otherwise @exception SQLException if a database access error occurs
Indicates that the best row identifier is NOT a pseudo column.Class DatabaseMetaData, int bestRowPseudoA possible value for the column
PSEUDO_COLUMN
in theResultSet
object returned by the methodgetBestRowIdentifier
.
Indicates that the best row identifier is a pseudo column.Class DatabaseMetaData, int bestRowSessionA possible value for the column
PSEUDO_COLUMN
in theResultSet
object returned by the methodgetBestRowIdentifier
.
Indicates that the scope of the best row identifier is the remainder of the current session.Class DatabaseMetaData, int bestRowTemporaryA possible value for the column
SCOPE
in theResultSet
object returned by the methodgetBestRowIdentifier
.
Indicates that the scope of the best row identifier is very temporary lasting only while the row is being used.Class DatabaseMetaData, int bestRowTransactionA possible value for the column
SCOPE
in theResultSet
object returned by the methodgetBestRowIdentifier
.
Indicates that the scope of the best row identifier is the remainder of the current transaction.Class DatabaseMetaData, int bestRowUnknownA possible value for the column
SCOPE
in theResultSet
object returned by the methodgetBestRowIdentifier
.
Indicates that the best row identifier may or may not be a pseudo column.Class DatabaseMetaData, int columnNoNullsA possible value for the column
PSEUDO_COLUMN
in theResultSet
object returned by the methodgetBestRowIdentifier
.
Indicates that the column might not allowClass DatabaseMetaData, int columnNullableNULL
values.A possible value for the column
NULLABLE
in theResultSet
returned by the methodgetColumns
.
Indicates that the column definitely allowsClass DatabaseMetaData, int columnNullableUnknownNULL
values.A possible value for the column
NULLABLE
in theResultSet
returned by the methodgetColumns
.
Indicates that the nullability of columns is unknown.Class DatabaseMetaData, int importedKeyCascadeA possible value for the column
NULLABLE
in theResultSet
returned by the methodgetColumns
.
Class DatabaseMetaData, int importedKeyInitiallyDeferredA possible value for the columns UPDATE_RULE and DELETE_RULE in the ResultSet objects returned by the methods getImportedKeys getExportedKeys and getCrossReference.For the columnUPDATE_RULE
itindicates that when the primary key is updated the foreign key (imported key) is changed to agree with it. For the columnDELETE_RULE
it indicates that when the primary key is deleted rows that imported that key are deleted.A possible value for the columns
UPDATE_RULE
andDELETE_RULE
in theResultSet
objects returned by the methodsgetImportedKeys
getExportedKeys
andgetCrossReference
.
Indicates deferrability. See SQL-92 for a definition.Class DatabaseMetaData, int importedKeyInitiallyImmediateA possible value for the column
DEFERRABILITY
in theResultSet
objects returned by the methodsgetImportedKeys
getExportedKeys
andgetCrossReference
.Indicates deferrability. See SQL-92 for a definition.
Indicates deferrability. See SQL-92 for a definition.Class DatabaseMetaData, int importedKeyNoActionA possible value for the column
DEFERRABILITY
in theResultSet
objects returned by the methodsgetImportedKeys
getExportedKeys
andgetCrossReference
.Indicates deferrability. See SQL-92 for a definition.
Class DatabaseMetaData, int importedKeyNotDeferrableA possible value forFor the columnsUPDATE_RULE
andDELETE_RULE
inindicates that if theResultSetprimaryobjects returned by the methodskey has been imported itgetImportedKeyscannotgetExportedKeysbeandupdatedgetCrossReferenceor deleted.
ForA possible value for the columnsUPDATE_RULE
andDELETE_RULE
it indicates that ifin theprimary keyResultSet
has been imported it cannotobjects returned by the methodsbegetImportedKeys
updatedgetExportedKeys
oranddeletedgetCrossReference
.
Indicates deferrability. See SQL-92 for a definition.Class DatabaseMetaData, int importedKeyRestrictA possible value for the column
DEFERRABILITY
in theResultSet
objects returned by the methodsgetImportedKeys
getExportedKeys
andgetCrossReference
.Indicates deferrability. See SQL-92 for a definition.
Class DatabaseMetaData, int importedKeySetDefaultA possible value for the columns UPDATE_RULE and DELETE_RULE in the ResultSet objects returned by the methods getImportedKeys getExportedKeys and getCrossReference.For the columnUPDATE_RULE
itindicates that a primary key may not be updated if it has been imported by another table as a foreign key. For the columnDELETE_RULE
itindicates that a primary key may not be deleted if it has been imported by another table as a foreign key.A possible value for the columns
UPDATE_RULE
andDELETE_RULE
in theResultSet
objects returned by the methodsgetImportedKeys
getExportedKeys
andgetCrossReference
.
Class DatabaseMetaData, int importedKeySetNullA possible value forFor the columnsUPDATE_RULE
andDELETE_RULE
inindicates that if theResultSetprimaryobjects returnedkey isbyupdated or deleted themethodsforeigngetImportedKeyskeygetExportedKeys(importedandkey)getCrossReferenceis set to the default value.
ForA possible value for the columnsUPDATE_RULE
andDELETE_RULE
it indicates that ifin theprimary key isResultSet
updated or deletedobjects returned by theforeign key (imported key) is setmethodstogetImportedKeys
thegetExportedKeys
defaultandvaluegetCrossReference
.
Class DatabaseMetaData, int procedureColumnInA possible value forFor the columnsUPDATE_RULE
andDELETE_RULE
inindicates that when theResultSetprimaryobjects returnedkey isbyupdated or deleted themethodsforeigngetImportedKeyskeygetExportedKeys(importedandkey) is changed to.
getCrossReferenceNULL
ForA possible value for the columnsUPDATE_RULE
andDELETE_RULE
it indicates that whenin theprimary key isResultSet
updated or deletedobjects returned by theforeign key (imported key)methodsisgetImportedKeys
changedgetExportedKeys
toand.
NULLgetCrossReference
Indicates that the column stores IN parameters.Class DatabaseMetaData, int procedureColumnInOutA possible value for the column
COLUMN_TYPE
in theResultSet
returned by the methodgetProcedureColumns
.
Indicates that the column stores INOUT parameters.Class DatabaseMetaData, int procedureColumnOutA possible value for the column
COLUMN_TYPE
in theResultSet
returned by the methodgetProcedureColumns
.
Indicates that the column stores OUT parameters.Class DatabaseMetaData, int procedureColumnResultA possible value for the column
COLUMN_TYPE
in theResultSet
returned by the methodgetProcedureColumns
.
Indicates that the column stores results.Class DatabaseMetaData, int procedureColumnReturnA possible value for the column
COLUMN_TYPE
in theResultSet
returned by the methodgetProcedureColumns
.
Indicates that the column stores return values.Class DatabaseMetaData, int procedureColumnUnknownA possible value for the column
COLUMN_TYPE
in theResultSet
returned by the methodgetProcedureColumns
.
Indicates that type of the column is unknown.Class DatabaseMetaData, int procedureNoNullsA possible value for the column
COLUMN_TYPE
in theResultSet
returned by the methodgetProcedureColumns
.
Indicates thatClass DatabaseMetaData, int procedureNoResultNULL
values are not allowed.A possible value for the column
NULLABLE
in theResultSet
object returned by the methodgetProcedureColumns
.
Indicates that the procedure does not return a result.Class DatabaseMetaData, int procedureNullableA possible value for column
PROCEDURE_TYPE
in theResultSet
object returned by the methodgetProcedures
.Indicates that the procedure does not return a result.
Indicates thatClass DatabaseMetaData, int procedureNullableUnknownNULL
values are allowed.A possible value for the column
NULLABLE
in theResultSet
object returned by the methodgetProcedureColumns
.
Indicates that whetherClass DatabaseMetaData, int procedureResultUnknownNULL
values are allowed is unknown.A possible value for the column
NULLABLE
in theResultSet
object returned by the methodgetProcedureColumns
.
Indicates that it is not known whether the procedure returns a result.Class DatabaseMetaData, int procedureReturnsResultA possible value for column
PROCEDURE_TYPE
in theResultSet
object returned by the methodgetProcedures
.Indicates that it is not known whether the procedure returns a result.
Indicates that the procedure returns a result.Class DatabaseMetaData, short tableIndexClusteredA possible value for column
PROCEDURE_TYPE
in theResultSet
object returned by the methodgetProcedures
.Indicates that the procedure returns a result.
Indicates that this table index is a clustered index.Class DatabaseMetaData, short tableIndexHashedA possible value for column
TYPE
in theResultSet
object returned by the methodgetIndexInfo
.Indicates that this table index is a clustered index.
Indicates that this table index is a hashed index.Class DatabaseMetaData, short tableIndexOtherA possible value for column
TYPE
in theResultSet
object returned by the methodgetIndexInfo
.Indicates that this table index is a hashed index.
Class DatabaseMetaData, short tableIndexStatisticA possible value for column TYPE in the ResultSet object returned by the method getIndexInfo.Indicates that this table index is not a clustered index a hashed index or table statistics; it is something other than these.A possible value for column
TYPE
in theResultSet
object returned by the methodgetIndexInfo
.
Class DatabaseMetaData, int typeNoNullsA possible value for column TYPE in the ResultSet object returned by the method getIndexInfo.Indicates that this column contains table statistics that are returned in conjunction with a table's index descriptions.A possible value for column
TYPE
in theResultSet
object returned by the methodgetIndexInfo
.
Indicates that aClass DatabaseMetaData, int typeNullableNULL
value is NOT allowed for this data type.A possible value for column
NULLABLE
in theResultSet
object returned by the methodgetTypeInfo
.Indicates that a NULL value is NOT allowed for this data type.
Indicates that aClass DatabaseMetaData, int typeNullableUnknownNULL
value is allowed for this data type.A possible value for column
NULLABLE
in theResultSet
object returned by the methodgetTypeInfo
.Indicates that a NULL value is allowed for this data type.
Indicates that it is not known whether aClass DatabaseMetaData, int typePredBasicNULL
value is allowed for this data type.A possible value for column
NULLABLE
in theResultSet
object returned by the methodgetTypeInfo
.Indicates that it is not known whether a NULL value is allowed for this data type.
Class DatabaseMetaData, int typePredCharA possible value for column SEARCHABLE in the ResultSet object returned by the method getTypeInfo.Indicates that one can base allWHERE
search clauses exceptWHERE . . . LIKE
on this data type.A possible value for column
SEARCHABLE
in theResultSet
object returned by the methodgetTypeInfo
.
Class DatabaseMetaData, int typePredNoneA possible value for column SEARCHABLE in the ResultSet object returned by the method getTypeInfo.Indicates that the onlyWHERE
search clause that can be based on this type isWHERE . . . LIKE
.A possible value for column
SEARCHABLE
in theResultSet
object returned by the methodgetTypeInfo
.
Indicates thatClass DatabaseMetaData, int typeSearchableWHERE
search clauses are not supported for this type.A possible value for column
SEARCHABLE
in theResultSet
object returned by the methodgetTypeInfo
.Indicates that WHERE search clauses are not supported for this type.
Indicates that allClass DatabaseMetaData, int versionColumnNotPseudoWHERE
search clauses can be based on this type.A possible value for column
SEARCHABLE
in theResultSet
object returned by the methodgetTypeInfo
.Indicates that all WHERE search clauses can be based on this type.
Indicates that this version column is NOT a pseudo column.Class DatabaseMetaData, int versionColumnPseudoA possible value for the column
PSEUDO_COLUMN
in theResultSet
object returned by the methodgetVersionColumns
.
Indicates that this version column is a pseudo column.Class DatabaseMetaData, int versionColumnUnknownA possible value for the column
PSEUDO_COLUMN
in theResultSet
object returned by the methodgetVersionColumns
.
Indicates that this version column may or may not be a pseudo column.A possible value for the column
PSEUDO_COLUMN
in theResultSet
object returned by the methodgetVersionColumns
.
Class Date, constructor Date(int, int, int)A thin wrapper around a millisecond value that allows JDBC to identify this as
aan SQLDATE
value. A milliseconds value represents the number of milliseconds that have passed since January 1 1970 00:00:00.000 GMT.To conform with the definition of SQL
DATE
the millisecond values wrapped by ajava.sql.Date
instance must be 'normalized' by setting the hours minutes seconds and milliseconds to zero in the particular time zone with which the instance is associated.
Constructs aClass Date, constructor Date(long)Date
object initialized with the given year month and day.The result is undefined if a given argument is out of bounds. @param year the year
-minus 1900; must be 0 to 8099. (Note that 8099 is 9999 minus 1900.) @param month 0 to 11 @param day 1 to 31 @deprecated instead use the constructorDate(long date)
Constructs aClass Date, int getHours()Date
object usingathe given milliseconds time value. If the givenmillisecondmilliseconds value contains time information the driver will set the time components to the time in the default time zone (the time zone of the Java virtual machine running the application) that corresponds to zero GMT. @param date milliseconds since January 1 1970 00:00:00 GMT not to exceed the milliseconds representation for the year 8099. A negative number indicates the number of milliseconds before January 1 1970 00:00:00 GMT.
This method is deprecated and should not be used because SQL Date values do not have a time component. @deprecated @exception java.lang.IllegalArgumentException if this method is invoked @see #setHoursClass Date, int getMinutes()
This method is deprecated and should not be used because SQL Date values do not have a time component. @deprecated @exception java.lang.IllegalArgumentException if this method is invoked @see #setMinutesClass Date, int getSeconds()
This method is deprecated and should not be used because SQL Date values do not have a time component. @deprecated @exception java.lang.IllegalArgumentException if this method is invoked @see #setSecondsClass Date, void setHours(int)
This method is deprecated and should not be used because SQL Date values do not have a time component. @deprecated @exception java.lang.IllegalArgumentException if this method is invoked @see #getHoursClass Date, void setMinutes(int)
This method is deprecated and should not be used because SQL Date values do not have a time component. @deprecated @exception java.lang.IllegalArgumentException if this method is invoked @see #getMinutesClass Date, void setSeconds(int)
This method is deprecated and should not be used because SQL Date values do not have a time component. @deprecated @exception java.lang.IllegalArgumentException if this method is invoked @see #getSecondsClass Date, void setTime(long)
Sets an existing Date
object using the given milliseconds time value. If the given milliseconds value contains time information the driver will set the time components to the time in the default time zone (the time zone of the Java virtual machine running the application) that corresponds to zero GMT. @param date milliseconds since January 1 1970 00:00:00 GMT not to exceed the milliseconds representation for the year 8099. A negative number indicates the number of milliseconds before January 1 1970 00:00:00 GMT.
Class Date, Date valueOf(String)Converts a string in JDBC date escape format to aDate
value. @param s date in format "yyyy-mm-dd" @return ajava.sql.Date
object representing the given date
Class Driver, Connection connect(String, Properties)ReturnsRetrievestrue ifwhether the driver thinks that it can open a connection to the given URL. Typically drivers will returntrue
if they understand the subprotocol specified in the URL andfalse
if theydon'tdo not. @param url the URL of the database @returntrue
if this drivercan connectunderstandstothe given URL;false
otherwise @exception SQLException if a database access error occurs
Attempts to make a database connection to the given URL. The driver should return "null" if it realizes it is the wrong kind of driver to connect to the given URL. This will be common as when the JDBC driver manager is asked to connect to a given URL it passes the URL to each loaded driver in turn.Class Driver, int getMajorVersion()The driver should
raise athrow anSQLException
if it is the right driver to connect to the given URL but has trouble connecting to the database.The
java.util.Properties
argument can be used topassedpass arbitrary string tag/value pairs as connection arguments. Normally at least "user" and "password" properties should be included in theProperties
object. @param url the URL of the database to which to connect @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 aConnection
object that represents a connection to the URL @exception SQLException if a database access error occurs
Class Driver, DriverPropertyInfo[] getPropertyInfo(String, Properties)GetsRetrieves the driver's major version number. Initially this should be 1. @return this driver's major version number
Gets information about the possible properties for this driver.Class Driver, boolean jdbcCompliant()The
getPropertyInfo
method is intended to allow a generic GUI tool to discover what properties it should prompt a human for in order to get enough information to connect to a database. Note that depending on the values the human has supplied so far additional values may become necessary so it may be necessary to iterate though several calls to thegetPropertyInfo method. @param url the URL of the database to which to connect @param info a proposed list of tag/value pairs that will be sent on connect open @return an array of
DriverPropertyInfo
objects describing possible properties. This array may be an empty array if no properties are required. @exception SQLException if a database access error occurs
Reports whether this driver is a genuine JDBCCOMPLIANTCompliantTM driver. A driver may only reporttrue
here if it passes the JDBC compliance tests; otherwise it is required to returnfalse
.JDBC compliance requires full support for the JDBC API and full support for SQL 92 Entry Level. It is expected that JDBC compliant drivers will be available for all the major commercial databases.
This method is not intended to encourage the development of non-JDBC compliant drivers but is a recognition of the fact that some vendors are interested in using the JDBC API and framework for lightweight databases that do not support full database functionality or for special databases such as document information retrieval where a SQL implementation may not be feasible. @return
true
if this driver is JDBC Compliant;false
otherwise
Class DriverManager, void deregisterDriver(Driver)The basic service for managing a set of JDBC drivers.
NOTE: TheDataSource
interface new in the JDBC 2.0 API provides another way to connect to a data source. The use of aDataSource
object is the preferred means of connecting to a data source.As part of its initialization the
DriverManager
class 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.ourDriver
Class.forName("my.sql.Driver");
When the method
getConnection
is called theDriverManager
will 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 aClass DriverManager, PrintStream getLogStream()Driverdriver from theDriverManager
's list. Applets can only deregisterDriversdrivers from their own classloaders. @param driver the JDBC Driver to drop @exception SQLException if a database access error occurs
Class DriverManager, PrintWriter getLogWriter()GetsRetrieves the logging/tracing PrintStream that is used by theDriverManager
and all drivers. @return the logging/tracing PrintStream; if disabled isnull
@deprecated @see #setLogStream
Class DriverManager, int getLoginTimeout()GetsRetrieves the log writer. ThegetLogWriter
andsetLogWriter
methods should be used instead of theget/setlogStream
methods which are deprecated. @return ajava.io.PrintWriter
object @seeWhat Is in the JDBC 2.0 API#setLogWriter @since 1.2
Gets the maximum time in seconds that a driver can wait when attempting to log in to a database. @return the driver login time limit in seconds @see #setLoginTimeoutClass DriverManager, void setLogStream(PrintStream)
Sets the logging/tracing PrintStream that is used by theClass DriverManager, void setLogWriter(PrintWriter)DriverManager
and all drivers.In the Java 2 SDK Standard Edition version 1.3 release this method checks to see that there is an
SQLPermission
object before setting the logging stream. If aSecurityManager
exists and itscheckPermission
method 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 itscheckPermission
method denies setting the log stream.@see SecurityManager#checkPermission @see #getLogStream
Sets the logging/tracingClass DriverManager, void setLoginTimeout(int)PrintWriter
object that is used by theDriverManager
and all drivers.There is a minor versioning problem created by the introduction of the method
setLogWriter
. The methodsetLogWriter
cannot create aPrintStream
object that will be returned bygetLogStream
---the Java platform does not provide a backward conversion. As a result a new application that usessetLogWriter
and also uses a JDBC 1.0 driver that usesgetLogStream
will 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
SQLPermission
object before setting the logging stream. If aSecurityManager
exists and itscheckPermission
method denies setting the log writer this method throws ajava.lang.SecurityException
. @param out the new logging/tracingPrintStream
object;null
to disable logging and tracing @throws SecurityException if a security manager exists and itscheckPermission
method denies setting the log writer @see SecurityManager#checkPermission @seeWhat Is in the JDBC 2.0 API#getLogWriter @since 1.2
Sets the maximum time in seconds that a driver will wait while attempting to connect to a database. @param seconds the login time limit in seconds @see #getLoginTimeout
An object that represents a precompiled SQL statement.Class PreparedStatement, void addBatch()A SQL statement is precompiled and stored in a
PreparedStatement
object. This object can then be used to efficiently execute this statement multiple times.Note: The
setXXXsetter methods (setShort
setString
and so on) 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 typethen the method
IntegerINTEGERsetInt
should be used.If arbitrary parameter type conversions are required the method
setObject
should be used with a target SQL type.In the following
Exampleexample of setting a parameter;con
isrepresents an active connection:PreparedStatement pstmt = con.prepareStatement("UPDATE EMPLOYEES SET SALARY = WHERE ID = "); pstmt.setBigDecimal(1 153833.00) pstmt.setInt(2 110592)@see Connection#prepareStatement @see ResultSetSome of the methods in this interface are new in the JDBC 2.0 API.
Adds a set of parameters to thisClass PreparedStatement, boolean execute()PreparedStatement
object'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
Executes the SQL statement in thisClass PreparedStatement, ResultSet executeQuery()PreparedStatement
object which may be any kind of SQL statement. Some prepared statements return multiple results; theexecute
method handles these complex statements as well as the simpler form of statements handled by the methodsexecuteQuery
andexecuteUpdate
.The
execute
method returns aboolean
to indicate the form of the first result. You must call either the methodgetResultSet
orgetUpdateCount
to retrieve the result; you must callgetMoreResults
to move to any subsequent result(s). @returntrue
if the first result is aResultSet
object;false
if the first result is an update count or there is no result @exception SQLException if a database access error occurs or an argument is supplied to this method @see Statement#execute @see Statement#getResultSet @see Statement#getUpdateCount @see Statement#getMoreResults
Executes the SQL query in thisClass PreparedStatement, int executeUpdate()PreparedStatement
object and returns theresultResultSet
setobject generated by the query. @return aResultSet
object that contains the data produced by the query; nevernull
@exception SQLException if a database access error occurs or the SQL statement does not return aResultSet
object
Executes the SQLClass PreparedStatement, ResultSetMetaData getMetaData()INSERT UPDATE or DELETEstatement in thisPreparedStatement
object.In additionwhich must be an SQLstatementsINSERT
UPDATE
orDELETE
statement; or an SQL statement thatreturnreturns nothing such asSQLa DDLstatements can be executedstatement. @return either (1) the row count forINSERT
UPDATE
orDELETE
statements;or (2) 0 for SQL statements that return nothing @exception SQLException if a database access error occurs or the SQL statement returns aResultSet
object
Class PreparedStatement, void setArray(int, Array)Gets theRetrieves anumberResultSetMetaData
typesobjectandthat contains information about thepropertiescolumns of theResultSet
object that will be returned when thisPreparedStatement
object is executed.Because
aPreparedStatement
object is precompiled it is possible to know about theResultSet
object'scolumnsthat it will return without having to execute it. Consequently it is possible to invoke the methodgetMetaData
on aPreparedStatement
object rather than waiting to execute it and then invoking theResultSet.getMetaData
method on theResultSet
object that is returned.NOTE: Using this method may be expensive for some drivers due to the lack of underlying DBMS support
. @return the description of aResultSet
object's columns ornull
if the driver cannot return aResultSetMetaData
object @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 givenClass PreparedStatement, void setBigDecimal(int, BigDecimal)Array
object.SetsThe driver converts this to anArraySQLparameterARRAY
value when it sends it to the database. @param i the first parameter is 1 the second is 2 ... @param x anArray
object that maps an SQLARRAY
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 toClass PreparedStatement, void setBlob(int, Blob)athe givenjava.math.BigDecimal
value. The driver converts this to an SQLNUMERIC
value 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 givenClass PreparedStatement, void setBoolean(int, boolean)Blob
object. The driver converts this to an SQLBLOB
value when it sends it to the database. @param i the first parameter is 1 the second is 2 ... @param x aBlob
object that maps 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 toClass PreparedStatement, void setByte(int, byte)athe given Javaboolean
value. The driver converts this to an SQLBIT
value 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 toClass PreparedStatement, void setBytes(int, byte[])athe given Javabyte
value. The driver converts this to an SQLTINYINT
value 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 toClass PreparedStatement, void setCharacterStream(int, Reader, int)athe given Java array of bytes. The driver converts this to an SQLVARBINARY
orLONGVARBINARY
(depending on the argument's size relative to the driver's limits onVARBINARY
values) 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 givenClass PreparedStatement, void setClob(int, Clob)Reader
object which is the given number of characters long. When a very large UNICODE value is input to aLONGVARCHAR
parameter it may be more practical to send it via ajava.io.Reader
object. The data will be read from the stream as needed until end-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
xreader thejava.io.Reader
reader whichobject that contains theUNICODEUnicode 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
Sets the designated parameter to the givenClass PreparedStatement, void setDate(int, Date)Clob
object. The driver converts this to an SQLCLOB
value when it sends it to the database. @param i the first parameter is 1 the second is 2 ... @param x aClob
object that maps 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 toClass PreparedStatement, void setDate(int, Date, Calendar)athe givenjava.sql.Date
value. The driver converts this to an SQLDATE
value 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 givenClass PreparedStatement, void setDouble(int, double)java.sql.Date
value using the givenCalendar
object. The driver uses theCalendar
object to construct an SQLDATE
value which the driver then sends to the database. With a aCalendar
object the driver can calculate the date taking into account a custom timezone. If noCalendar
object is specified the driver uses the default timezone which is that of the virtual machine running the application. @param parameterIndex the first parameter is 1 the second is 2 ... @param x the parameter value @param cal theCalendar
object 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 toClass PreparedStatement, void setFloat(int, float)athe given Javadouble
value. The driver converts this to an SQLDOUBLE
value 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 toClass PreparedStatement, void setInt(int, int)athe given Javafloat
value. The driver converts this to an SQLFLOAT
value 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 toClass PreparedStatement, void setLong(int, long)athe given Javaint
value. The driver converts this to an SQLINTEGER
value 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 toClass PreparedStatement, void setNull(int, int, String)athe given Javalong
value. The driver converts this to an SQLBIGINT
value 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 setObject(int, Object)NULL
. This version of the methodsetNull
should be used for user-defined types and REF type parameters. Examples of user-defined 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-defined 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-defined 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-defined or REF type the given typeName is ignored. @param
parameterIndexparamIndex 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-defined type; ignored if the parameter is not a user-defined 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, int)Sets the value of the designated parameter using the given object. The second parameter must be of type
Object
; therefore thejava.lang
equivalent objects should be used for built-in types.The JDBC specification specifies a standard mapping from Java
Object
types to SQL types. The given argument will be converted to the corresponding SQL type before being sent to the database.Note that this method may be used to pass datatabase- specific abstract data types by using a driver-specific Java type. If the object is of a class implementing the interface
SQLData
the JDBC driver should call the methodSQLData.writeSQL
to write it to the SQL data stream. If on the other hand the object is of a class implementingRef
Blob
Clob
Struct
orArray
the driver should pass it to the database as a value of the corresponding SQL type.thenThis method throws an exception if there is an ambiguity for example if the object is of a class implementing more than one of the 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 or the type of the given object is ambiguous
Class PreparedStatement, void setRef(int, Ref)Sets the value of the designated parameter with the given object. The second argument must be an object type; for integral values the
java.lang
equivalent 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 call the methodSQLData.writeSQL
to write it to the SQL data stream. If on the other hand the object is of a class implementingRef
Blob
Clob
Struct
orArray
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
datatabasedatabase-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
Sets the designated parameter to the givenClass PreparedStatement, void setShort(int, short)REF(<structured-type>)
value. The driver converts this to an SQLREF
value when it sends it to the database. @param i the first parameter is 1 the second is 2 ... @param x an SQLREF
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 toClass PreparedStatement, void setString(int, String)athe given Javashort
value. The driver converts this to an SQLSMALLINT
value 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 toClass PreparedStatement, void setTime(int, Time)athe given JavaString
value. The driver converts this to an SQLVARCHAR
orLONGVARCHAR
value (depending on the argument's size relative to the driver's limits onVARCHAR
values) 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 toClass PreparedStatement, void setTime(int, Time, Calendar)athe givenjava.sql.Time
value. The driver converts this to an SQLTIME
value 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 givenClass PreparedStatement, void setTimestamp(int, Timestamp)java.sql.Time
value using the givenCalendar
object. The driver uses theCalendar
object to construct an SQLTIME
value which the driver then sends to the database. With a aCalendar
object the driver can calculate the time taking into account a custom timezone. If noCalendar
object is specified the driver uses the default timezone which is that of the virtual machine running the application. @param parameterIndex the first parameter is 1 the second is 2 ... @param x the parameter value @param cal theCalendar
object 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 toClass PreparedStatement, void setTimestamp(int, Timestamp, Calendar)athe givenjava.sql.Timestamp
value. The driver converts this to an SQLTIMESTAMP
value 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 givenClass PreparedStatement, void setUnicodeStream(int, InputStream, int)java.sql.Timestamp
value using the givenCalendar
object. The driver uses theCalendar
object to construct an SQLTIMESTAMP
value which the driver then sends to the database. With aaCalendar
object the driver can calculate the timestamp taking into account a custom timezone. If noCalendar
object is specified the driver uses the default timezone which is that of the virtual machine running the application. @param parameterIndex the first parameter is 1 the second is 2 ... @param x the parameter value @param cal theCalendar
object 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. A Unicode character has two bytes with the first byte being the high byte and the second being the low byte. When a very largeUNICODEUnicode value is input to aLONGVARCHAR
parameter it may be more practical to send it via ajava.io.InputStream
object. The data will be read from the stream as needed until end-of-file is reached. The JDBC driver will do any necessary conversion fromUNICODEUnicode 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
theajava
input.io.InputStreamstream whichobject that contains theUNICODEUnicode parameter value as two-byte Unicode characters @param length the number of bytes in the stream @exception SQLException if a database access error occurs @deprecated
The mapping in the Java programming language of an SQLClass Ref, String getBaseTypeName()REF
value which is a reference to an SQL structured type value in the database.SQL
REF
values are stored in aspecialtable that contains instances of a referenceable SQL structured type and eachREF
value is a unique identifier for one instance in that table. An SQLREF
value may be used in place of the SQL structured type it references; it maybe usedeither aseithera column value in a table or an attribute value in a structured type.Because an SQL
REF
value is a logical pointer to an SQL structured type aRef
object is by default also a logical pointer; thus. Thus retrieving an SQLREF
value as aRef
object does not materialize the attributes of the structured type on the client.A
Ref
object can besaved to persistent storage and is dereferenced by passing it as a parameter to an SQL statement andstoredexecutingin thestatement. The Ref interface is newdatabaseinusing theJDBC 2PreparedStatement.
0setRefAPImethod. @see Struct @since 1.2
Retrieves the fully-qualified SQL name of the SQL structured type that thisRef
object references. @return the fully-qualified SQL name of the referenced SQL structured type @exception SQLException if a database access error occurs @since 1.2@see What Is in the JDBC 2.0 API
A table of data representing a database result set which is usually generated by executing a statement that queries the database.Class ResultSet, boolean absolute(int)A
ResultSet
object maintains a cursor pointing to its current row of data. Initially the cursor is positioned before the first row. Thenext
method moves the cursor to the next row and because it returnsfalse
when there are no more rows in theResultSet
object it can be used in awhile
loop to iterate through the result set.A default
ResultSet
object is not updatable and has a cursor that moves forward only. Thusit is possibleyoutocan iterate through it only once and only from the first row to the last row.New methods in the JDBC 2.0 API makeItitis possible to produceResultSet
objects that are scrollable and/or updatable. The following code fragment in whichcon
is a validConnection
object illustrates how to make a result set that is scrollable and insensitive to updates by others and that is updatable. SeeResultSet
fields 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 updatableTheResultSet
interface provides getter methods (
getXXXgetBooleanmethodsgetLong
and so on) for retrieving column values from the current row. Values can be 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 portability result set columns within each row should be read in left-to-right order and each column should be read only once.For the
getXXXgetter methods a JDBC driver attempts to convert the underlying data to the Java type specified in theXXX part of the getXXXgetter method and returns a suitable Java value. The JDBC specification has a table showing the allowable mappings from SQL types to Java typeswiththat can be used by theResultSet
getter methods..getXXX
Column names used as input to
getXXXgetter methods are case insensitive. When agetXXXgetter method is called with a column name and several columns have the same name the value of the first matching column will be returned. The column name option is designed to be used when column names are used in the SQL query 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
updateXXXupdater methods were added to this interface in the JDBC 2.0 API (JavaTM 2 SDK Standard Edition version 1.2). The comments regarding parameters to thegetXXXgetter methods also apply to parameters to theupdateXXXupdater methods.The
updateXXXupdater methods may be used in two ways:
- to update a column value in the current row. In a scrollable
ResultSet
object 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 theNAME
column in the fifth row of theResultSet
objectrs
and then uses the methodupdateRow
to update the data source table from whichrs
was derived.rs.absolute(5); // moves the cursor to the fifth row of rs rs.updateString("NAME" "AINSWORTH"); // updates the //NAME
column of row 5 to beAINSWORTH
rs.updateRow(); // updates the row in the data source- to insert column values into the insert row. An updatable
ResultSet
object 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 intors
and 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 beAINSWORTH
rs.updateInt(2 35); // updates the second column to be35
rs.updateBoolean(3 true); // updates the third row totrue
rs.insertRow(); rs.moveToCurrentRow();A
ResultSet
object is automatically closed when theStatement
object that generated it is closed re-executed or used to retrieve the next result from a sequence of multiple results.The number types and properties of a
ResultSet
object's columns are provided by theResulSetMetaData
object returned by theResultSet.getMetaData
method. @see Statement#executeQuery @see Statement#getResultSet @see ResultSetMetaData
Moves the cursor to the given row number in thisClass ResultSet, void afterLast()ResultSet
object.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)
moves 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 the first row or after the last row.
Note: Calling
absolute(1)
is the same as callingfirst()
. Callingabsolute(-1)
is the same as callinglast()
. @param row the number of the row to which the cursor should move. A positive number indicates the row number counting from the beginning of the result set; a negative number indicates the row number counting from the end of the result set @returntrue
if the cursor is on the result set;false
otherwise @exception SQLException if a database access error occursthe row is 0or the result set type isTYPE_FORWARD_ONLY
@since 1.2@see What Is in the JDBC 2.0 API
Moves the cursor to the end of thisClass ResultSet, void beforeFirst()ResultSet
object just after the last row. This 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
Moves the cursor to the front of thisClass ResultSet, void cancelRowUpdates()ResultSet
object just before the first row. This 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
Cancels the updates made to the current row in thisClass ResultSet, void deleteRow()ResultSet
object. This method may be called after calling anupdateXXXupdater method(s) and before calling the methodupdateRow
to roll back the updates made to a row. If no updates have been made orupdateRow
has already been called this 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
Deletes the current row from thisClass ResultSet, int findColumn(String)ResultSet
object and from the underlying database. This 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()ResultSet
column name to itsResultSet
column index. @param columnName the name of the column @return the column index of the given column name @exception SQLException if theResultSet
object does not containcolumnName
or a database access error occurs
Moves the cursor to the first row in thisClass ResultSet, Array getArray(String)ResultSet
object. @returntrue
if the cursor is on a valid row;false
if 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)ReturnsRetrieves the value of the designated column in the current row of thisResultSet
object as anArray
object in the Java programming language. @param colName the name of the column from which to retrieve the value @return anArray
object representing the SQLARRAY
value in the specified column @sinceexception1.2SQLException@seeifWhataIs in the JDBCdatabase access error occurs2.0@sinceAPI1.2
Class ResultSet, InputStream getAsciiStream(String)ReturnsRetrieves the value of the designated column in the current row of thisResultSet
object as anArray
object in the Java programming language. @param i the first column is 1 the second is 2 ... @return anArray
object representing the SQLARRAY
value in the specified column @sinceexception1.2SQLException@seeifWhataIs in the JDBCdatabase access error occurs2.0@sinceAPI1.2
Class ResultSet, InputStream getAsciiStream(int)GetsRetrieves the value of the designated column in the current row of thisResultSet
object 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
getXXXgetter method implicitly closes the stream. Also a stream may return0
when the methodavailable
is 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 SQLNULL
the value returned isnull
. @exception SQLException if a database access error occurs
Class ResultSet, BigDecimal getBigDecimal(String)GetsRetrieves the value of the designated column in the current row of thisResultSet
object 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
getXXXgetter method implicitly closes the stream. Also a stream may return0
when the methodInputStream.available
is 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; if the value is SQLNULL
the value returned isnull
@exception SQLException if a database access error occurs
Class ResultSet, BigDecimal getBigDecimal(String, int)GetsRetrieves the value of the designated column in the current row of thisResultSet
object as ajava.math.BigDecimal
with full precision. @param columnName the column name @return the column value (full precision); if the value is SQLNULL
the value returned isnull
in 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, BigDecimal getBigDecimal(int)GetsRetrieves the value of the designated column in the current row of thisResultSet
object as ajava.math.BigDecimal
in 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 SQLNULL
the value returned isnull
@exception SQLException if a database access error occurs @deprecated
Class ResultSet, BigDecimal getBigDecimal(int, int)GetsRetrieves the value of the designated column in the current row of thisResultSet
object as ajava.math.BigDecimal
with full precision. @param columnIndex the first column is 1 the second is 2 ... @return the column value (full precision); if the value is SQLNULL
the value returned isnull
in 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 getBinaryStream(String)GetsRetrieves the value of the designated column in the current row of thisResultSet
object as ajava.sql.BigDecimal
in 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 SQLNULL
the value returned isnull
@exception SQLException if a database access error occurs @deprecated
Class ResultSet, InputStream getBinaryStream(int)GetsRetrieves the value of the designated column in the current row of thisResultSet
object as a stream of uninterpretedbyte
s. The value can then be read in chunks from the stream. This method is particularly suitable for retrieving largeLONGVARBINARY
values.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
getXXXgetter method implicitly closes the stream. Also a stream may return0
when the methodavailable
is 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 the value is SQLNULL
the result isnull
@exception SQLException if a database access error occurs
Class ResultSet, Blob getBlob(String)GetsRetrieves the value ofa column in the current row as a stream of Gets the value ofthe designated column in the current row of thisResultSet
object 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 largeLONGVARBINARY
values.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
getXXXgetter method implicitly closes the stream. Also a stream may return0
when the methodInputStream.available
is 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 the value is SQLNULL
the value returned isnull
@exception SQLException if a database access error occurs
Class ResultSet, Blob getBlob(int)ReturnsRetrieves the value of the designated column in the current row of thisResultSet
object as aBlob
object in the Java programming language. @param colName the name of the column from which to retrieve the value @return aBlob
object representing the SQLBLOB
value in the specified column @sinceexception1.2SQLException@seeifWhataIs in the JDBCdatabase access error occurs2.0@sinceAPI1.2
Class ResultSet, boolean getBoolean(String)ReturnsRetrieves the value of the designated column in the current row of thisResultSet
object as aBlob
object in the Java programming language. @param i the first column is 1 the second is 2 ... @return aBlob
object representing the SQLBLOB
value in the specified column @sinceexception1.2SQLException@seeifWhataIs in the JDBCdatabase access error occurs2.0@sinceAPI1.2
Class ResultSet, boolean getBoolean(int)GetsRetrieves the value of the designated column in the current row of thisResultSet
object as aboolean
in the Java programming language. @param columnName the SQL name of the column @return the column value; if the value is SQLNULL
the value returned isfalse
@exception SQLException if a database access error occurs
Class ResultSet, byte getByte(String)GetsRetrieves the value of the designated column in the current row of thisResultSet
object as aboolean
in the Java programming language. @param columnIndex the first column is 1 the second is 2 ... @return the column value; if the value is SQLNULL
the value returned isfalse
@exception SQLException if a database access error occurs
Class ResultSet, byte getByte(int)GetsRetrieves the value of the designated column in the current row of thisResultSet
object as abyte
in the Java programming language. @param columnName the SQL name of the column @return the column value; if the value is SQLNULL
the value returned is0
@exception SQLException if a database access error occurs
Class ResultSet, byte[] getBytes(String)GetsRetrieves the value of the designated column in the current row of thisResultSet
object as abyte
in the Java programming language. @param columnIndex the first column is 1 the second is 2 ... @return the column value; if the value is SQLNULL
the value returned is0
@exception SQLException if a database access error occurs
Class ResultSet, byte[] getBytes(int)GetsRetrieves the value of the designated column in the current row of thisResultSet
object as abyte
array 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 SQLNULL
the value returned isnull
@exception SQLException if a database access error occurs
Class ResultSet, Reader getCharacterStream(String)GetsRetrieves the value of the designated column in the current row of thisResultSet
object as abyte
array 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 SQLNULL
the value returned isnull
@exception SQLException if a database access error occurs
Class ResultSet, Reader getCharacterStream(int)GetsRetrieves the value of the designated column in the current row of thisResultSet
object as ajava.io.Reader
object. @param columnName the name of the column @return ajava.io.Reader
object that contains the column value; if the value is SQLNULL
the value returned isnull
in the Java programming language.@param columnName the name of the column @returnexceptionthe value inSQLExceptionthe specified column as aif a database access errorjava.io.Readeroccurs @since 1.2@see What Is in the JDBC 2.0 API
Class ResultSet, Clob getClob(String)GetsRetrieves the value of the designated column in the current row of thisResultSet
object as ajava.io.Reader
object. @return ajava.io.Reader
object that contains the column value; if the value is SQLNULL
the value returned isnull
in the Java programming language. @param columnIndex the first column is 1 the second is 2 ... @sinceexception1.2SQLException@seeifWhataIs in the JDBCdatabase access error occurs2.0@sinceAPI1.2
Class ResultSet, Clob getClob(int)ReturnsRetrieves the value of the designated column in the current row of thisResultSet
object as aClob
object in the Java programming language. @param colName the name of the column from which to retrieve the value @return aClob
object representing the SQLCLOB
value in the specified column @sinceexception1.2SQLException@seeifWhataIs in the JDBCdatabase access error occurs2.0@sinceAPI1.2
Class ResultSet, int getConcurrency()ReturnsRetrieves the value of the designated column in the current row of thisResultSet
object as aClob
object in the Java programming language. @param i the first column is 1 the second is 2 ... @return aClob
object representing the SQLCLOB
value in the specified column @sinceexception1.2SQLException@seeifWhataIs in the JDBCdatabase access error occurs2.0@sinceAPI1.2
Class ResultSet, String getCursorName()ReturnsRetrieves the concurrency mode of thisResultSet
object. The concurrency used is determined by theStatement
object that created the result set. @return the concurrency type eitherResultSet.CONCUR_READ_ONLY
orResultSet.CONCUR_UPDATABLE
@exception SQLException if a database access error occurs @since 1.2@see What Is in the JDBC 2.0 API
Class ResultSet, Date getDate(String)GetsRetrieves the name of the SQL cursor used by thisResultSet
object.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
statement should be of the form
selectSELECT'selectSELECT
. IfforFORupdate'UPDATEthe 'for update'FOR
is omitted the positioned updates may fail.clauseUPDATEThe JDBC API supports this SQL feature by providing the name of the SQL cursor used by a
ResultSet
object. The current row of aResultSet
object is also the current row of this SQL cursor.Note: If positioned update is not supported a
SQLException
is thrown. @return the SQL name for thisResultSet
object's cursor @exception SQLException if a database access error occurs
Class ResultSet, Date getDate(String, Calendar)GetsRetrieves the value of the designated column in the current row of thisResultSet
object as ajava.sql.Date
object in the Java programming language. @param columnName the SQL name of the column @return the column value; if the value is SQLNULL
the value returned isnull
@exception SQLException if a database access error occurs
Class ResultSet, Date getDate(int)ReturnsRetrieves the value of the designated column in the current row of thisResultSet
object as ajava.sql.Date
object in the Java programming language. This method uses the given calendar to construct an appropriate millisecond value for the date 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 thejava.util.Calendar
object to use in constructing the date @return the column value as ajava.sql.Date
object; if the value is SQLNULL
the value returned isnull
in 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, Date getDate(int, Calendar)GetsRetrieves the value of the designated column in the current row of thisResultSet
object as ajava.sql.Date
object in the Java programming language. @param columnIndex the first column is 1 the second is 2 ... @return the column value; if the value is SQLNULL
the value returned isnull
@exception SQLException if a database access error occurs
Class ResultSet, double getDouble(String)ReturnsRetrieves the value of the designated column in the current row of thisResultSet
object as ajava.sql.Date
object in the Java programming language. This method uses the given calendar to construct an appropriate millisecond value for the date if the underlying database does not store timezone information. @param columnIndex the first column is 1 the second is 2 ... @param cal thejava.util.Calendar
object to use in constructing the date @return the column value as ajava.sql.Date
object; if the value is SQLNULL
the value returned isnull
in 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, double getDouble(int)GetsRetrieves the value of the designated column in the current row of thisResultSet
object as adouble
in the Java programming language. @param columnName the SQL name of the column @return the column value; if the value is SQLNULL
the value returned is0
@exception SQLException if a database access error occurs
Class ResultSet, int getFetchDirection()GetsRetrieves the value of the designated column in the current row of thisResultSet
object as adouble
in the Java programming language. @param columnIndex the first column is 1 the second is 2 ... @return the column value; if the value is SQLNULL
the value returned is0
@exception SQLException if a database access error occurs
Class ResultSet, int getFetchSize()ReturnsRetrieves the fetch direction for thisResultSet
object. @return the current fetch direction for thisResultSet
object @exception SQLException if a database access error occurs @since 1.2 @seeWhat Is in the JDBC 2.0 API#setFetchDirection
Class ResultSet, float getFloat(String)ReturnsRetrieves the fetch size for thisResultSet
object. @return the current fetch size for thisResultSet
object @exception SQLException if a database access error occurs @since 1.2 @seeWhat Is in the JDBC 2.0 API#setFetchSize
Class ResultSet, float getFloat(int)GetsRetrieves the value of the designated column in the current row of thisResultSet
object as afloat
in the Java programming language. @param columnName the SQL name of the column @return the column value; if the value is SQLNULL
the value returned is0
@exception SQLException if a database access error occurs
Class ResultSet, int getInt(String)GetsRetrieves the value of the designated column in the current row of thisResultSet
object as afloat
in the Java programming language. @param columnIndex the first column is 1 the second is 2 ... @return the column value; if the value is SQLNULL
the value returned is0
@exception SQLException if a database access error occurs
Class ResultSet, int getInt(int)GetsRetrieves the value of the designated column in the current row of thisResultSet
object as anint
in the Java programming language. @param columnName the SQL name of the column @return the column value; if the value is SQLNULL
the value returned is0
@exception SQLException if a database access error occurs
Class ResultSet, long getLong(String)GetsRetrieves the value of the designated column in the current row of thisResultSet
object as anint
in the Java programming language. @param columnIndex the first column is 1 the second is 2 ... @return the column value; if the value is SQLNULL
the value returned is0
@exception SQLException if a database access error occurs
Class ResultSet, long getLong(int)GetsRetrieves the value of the designated column in the current row of thisResultSet
object as along
in the Java programming language. @param columnName the SQL name of the column @return the column value; if the value is SQLNULL
the value returned is0
@exception SQLException if a database access error occurs
Class ResultSet, Object getObject(String)GetsRetrieves the value of the designated column in the current row of thisResultSet
object as along
in the Java programming language. @param columnIndex the first column is 1 the second is 2 ... @return the column value; if the value is SQLNULL
the value returned is0
@exception SQLException if a database access error occurs
Class ResultSet, Object getObject(String, Map)Gets the value of the designated column in the current row of this
ResultSet
object as anObject
in the Java programming 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 specification. If the value is an SQL
NULL
the driver returns a Javanull
.This method may also be used to read datatabase-specific abstract data types.
In the JDBC 2.0 API the behavior of the method
getObject
is extended to materialize data of SQL user-defined types. When a 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.Object
holding the column value @exception SQLException if a database access error occurs
Class ResultSet, Object getObject(int)ReturnsRetrieves the value of the designated column in the current row of thisResultSet
object as anObject
in the Java programming language. If the value is an SQLNULL
the driver returns a Javanull
. This method uses the specifiedMap
object for custom mapping if appropriate. @param colName the name of the column from which to retrieve the value @param map ajava.util.Map
object that contains the mapping from SQL type names to classes in the Java programming language @return anObject
representing the SQL value in the specified column @sinceexception1.2SQLException@seeifWhataIs in the JDBCdatabase access error occurs2.0@sinceAPI1.2
Class ResultSet, Object getObject(int, Map)Gets the value of the designated column in the current row of this
ResultSet
object as anObject
in the Java programming 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 specification. If the value is an SQL
NULL
the driver returns a Javanull
.This method may also be used to read datatabase-specific abstract data types. In the JDBC 2.0 API the behavior of method
getObject
is extended to materialize data of SQL user-defined types. When a 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.Object
holding the column value @exception SQLException if a database access error occurs
Class ResultSet, Ref getRef(String)ReturnsRetrieves the value of the designated column in the current row of thisResultSet
object as anObject
in the Java programming language. If the value is an SQLNULL
the driver returns a Javanull
. This method uses the givenMap
object 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.Map
object that contains the mapping from SQL type names to classes in the Java programming language @return anObject
in the Java programming language representing the SQL value @sinceexception1.2SQLException@seeifWhataIs in the JDBCdatabase access error occurs2.0@sinceAPI1.2
Class ResultSet, Ref getRef(int)ReturnsRetrieves the value of the designated column in the current row of thisResultSet
object as aRef
object in the Java programming language. @param colName the column name @return aRef
object representing the SQLREF
value in the specified column @sinceexception1.2SQLException@seeifWhataIs in the JDBCdatabase access error occurs2.0@sinceAPI1.2
Class ResultSet, int getRow()ReturnsRetrieves the value of the designated column in the current row of thisResultSet
object as aRef
object in the Java programming language. @param i the first column is 1 the second is 2 ... @return aRef
object representing an SQLREF
value @sinceexception1.2SQLException@seeifWhataIs in the JDBCdatabase access error occurs2.0@sinceAPI1.2
Retrieves the current row number. The first row is number 1 the second number 2 and so on. @return the current row number;Class ResultSet, short getShort(String)0
if 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
Class ResultSet, short getShort(int)GetsRetrieves the value of the designated column in the current row of thisResultSet
object as ashort
in the Java programming language. @param columnName the SQL name of the column @return the column value; if the value is SQLNULL
the value returned is0
@exception SQLException if a database access error occurs
Class ResultSet, Statement getStatement()GetsRetrieves the value of the designated column in the current row of thisResultSet
object as ashort
in the Java programming language. @param columnIndex the first column is 1 the second is 2 ... @return the column value; if the value is SQLNULL
the value returned is0
@exception SQLException if a database access error occurs
Class ResultSet, String getString(String)ReturnsRetrieves theStatement
object that produced thisResultSet
object. If the result set was generated some other way such as by aDatabaseMetaData
method this method returnsnull
. @return theStatment
object that produced thisResultSet
object ornull
if 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
Class ResultSet, String getString(int)GetsRetrieves the value of the designated column in the current row of thisResultSet
object as aString
in the Java programming language. @param columnName the SQL name of the column @return the column value; if the value is SQLNULL
the value returned isnull
@exception SQLException if a database access error occurs
Class ResultSet, Time getTime(String)GetsRetrieves the value of the designated column in the current row of thisResultSet
object as aString
in the Java programming language. @param columnIndex the first column is 1 the second is 2 ... @return the column value; if the value is SQLNULL
the value returned isnull
@exception SQLException if a database access error occurs
Class ResultSet, Time getTime(String, Calendar)GetsRetrieves the value of the designated column in the current row of thisResultSet
object as ajava.sql.Time
object in the Java programming language. @param columnName the SQL name of the column @return the column value; if the value is SQLNULL
the value returned isnull
@exception SQLException if a database access error occurs
Class ResultSet, Time getTime(int)ReturnsRetrieves the value of the designated column in the current row of thisResultSet
object as ajava.sql.Time
object in the Java programming language. This method uses the given calendar to construct an appropriate millisecond value for the time if the underlying database does not store timezone information. @param columnName the SQL name of the column @param cal thejava.util.Calendar
object to use in constructing the time @param cal the calendar to use in constructing the time @return the column value as ajava.sql.Time
object; if the value is SQLNULL
the value returned isnull
in 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, Time getTime(int, Calendar)GetsRetrieves the value of the designated column in the current row of thisResultSet
object as ajava.sql.Time
object in the Java programming language. @param columnIndex the first column is 1 the second is 2 ... @return the column value; if the value is SQLNULL
the value returned isnull
@exception SQLException if a database access error occurs
Class ResultSet, Timestamp getTimestamp(String)ReturnsRetrieves the value of the designated column in the current row of thisResultSet
object as ajava.sql.Time
object in the Java programming language. This method uses the given calendar to construct an appropriate millisecond value for the time if the underlying database does not store timezone information. @param columnIndex the first column is 1 the second is 2 ... @param cal thejava.util.Calendar
object to use in constructing the time @return the column value as ajava.sql.Time
object; if the value is SQLNULL
the value returned isnull
in 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, Timestamp getTimestamp(String, Calendar)GetsRetrieves the value of the designated column in the current row of thisResultSet
object as ajava.sql.Timestamp
object. @param columnName the SQL name of the column @return the column value; if the value is SQLNULL
the value returned isnull
@exception SQLException if a database access error occurs
Class ResultSet, Timestamp getTimestamp(int)ReturnsRetrieves the value of the designated column in the current row of thisResultSet
object as ajava.sql.Timestamp
object in the Java programming language. This method uses the given calendar to construct an appropriate millisecond value for the timestamp if the underlying database does not store timezone information. @param columnName the SQL name of the column @param cal thejava.util.Calendar
object to use in constructing the date @return the column value as ajava.sql.Timestamp
object; if the value is SQLNULL
the value returned isnull
in 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, Timestamp getTimestamp(int, Calendar)GetsRetrieves the value of the designated column in the current row of thisResultSet
object as ajava.sql.Timestamp
object in the Java programming language. @param columnIndex the first column is 1 the second is 2 ... @return the column value; if the value is SQLNULL
the value returned isnull
@exception SQLException if a database access error occurs
Class ResultSet, int getType()ReturnsRetrieves the value of the designated column in the current row of thisResultSet
object as ajava.sql.Timestamp
object in the Java programming language. This method uses the given calendar to construct an appropriate millisecond value for the timestamp if the underlying database does not store timezone information. @param columnIndex the first column is 1 the second is 2 ... @param cal thejava.util.Calendar
object to use in constructing the timestamp @return the column value as ajava.sql.Timestamp
object; if the value is SQLNULL
the value returned isnull
in 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)ReturnsRetrieves the type of thisResultSet
object. The type is determined by theStatement
object that created the result set. @returnResultSet.TYPE_FORWARD_ONLY
ResultSet.TYPE_SCROLL_INSENSITIVE
orResultSet.TYPE_SCROLL_SENSITIVE
@exception SQLException if a database access error occurs @since 1.2@see What Is in the JDBC 2.0 API
Class ResultSet, InputStream getUnicodeStream(int)GetsRetrieves the value of the designated column in the current row of thisResultSet
object as a stream of two-byte Unicode characters. The first byte is the high byte; the second byte is the low byte. The value can then be read in chunks from the stream. This method is particularly suitable for retrieving largeLONGVARCHAR
values. The JDBC technology-enabled 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 Java virtual 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
getXXXgetter method implicitly closes the stream. Also a stream may return0
when the methodInputStream.available
is 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 SQLNULL
the value returned isnull
. @exception SQLException if a database access error occurs @deprecated usegetCharacterStream
instead
Class ResultSet, SQLWarning getWarnings()GetsRetrieves the value ofa column in the current row as a stream of Gets the value ofthe designated column in the current row of thisResultSet
object as as a stream of two-byte Unicode characters. The first byte is the high byte; the second byte is the low byte. 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 Unicode.The byte format of the Unicode stream must be Java UTF-8 as specified in the Java virtual 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
getXXXgetter method implicitly closes the stream. Also a stream may return0
when the methodInputStream.available
is 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 streamin JavaofUTFtwo-8byteformatUnicode characters; if the value is SQLNULL
the value returned isnull
@exception SQLException if a database access error occurs @deprecated usegetCharacterStream
in place ofgetUnicodeStream
Class ResultSet, void insertRow()ReturnsRetrieves the first warning reported by calls on thisResultSet
object. Subsequent warnings on thisResultSet
object will be chained to theSQLWarning
object that this method returns.The warning chain is automatically cleared each time a new row is read. This method may not be called on a
ResultSet
object that has been closed; doing so will cause anSQLException
to be thrown.Note: This warning chain only covers warnings caused by
ResultSet
methods. Any warning caused byStatement
methods (such as reading OUT parameters) will be chained on theStatement
object. @return the firstSQLWarning
object reported ornull
if there are none @exception SQLException if a database access error occurs or this method is called on a closed result set
Inserts the contents of the insert row into thisClass ResultSet, boolean isAfterLast()ResultSet
objaectobject and into the database. The 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()IndicatesRetrieves whether the cursor is after the last row in thisResultSet
object. @returntrue
if the cursor is after the last row;false
if the cursor is at 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()IndicatesRetrieves whether the cursor is before the first row in thisResultSet
object. @returntrue
if the cursor is before the first row;false
if the cursor is at 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()IndicatesRetrieves whether the cursor is on the first row of thisResultSet
object. @returntrue
if the cursor is on the first row;false
otherwise @exception SQLException if a database access error occurs @since 1.2@see What Is in the JDBC 2.0 API
Class ResultSet, boolean last()IndicatesRetrieves whether the cursor is on the last row of thisResultSet
object. Note: Calling the methodisLast
may 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. @returntrue
if the cursor is on the last row;false
otherwise @exception SQLException if a database access error occurs @since 1.2@see What Is in the JDBC 2.0 API
Moves the cursor to the last row in thisClass ResultSet, void moveToCurrentRow()ResultSet
object. @returntrue
if the cursor is on a valid row;false
if 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
Moves 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.2Class ResultSet, void moveToInsertRow()@see What Is in the JDBC 2.0 API
Moves 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 theClass ResultSet, boolean previous()updateXXXupdater methods prior to inserting the row into the result set. Only theupdateXXXupdatergetXXXgetter andinsertRow
methods 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
. AnupdateXXXupdater method must be called before agetXXXgetter method 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 to the previous row in thisClass ResultSet, void refreshRow()ResultSet
object.Note: Calling the method previous() is not the same as calling the method relative(-1) because it makes sense to callprevious() when there is no current row.@returntrue
if the cursor is on a valid row;false
if 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
Refreshes the current row with its most recent value in the database. This method cannot be called when the cursor is on the insert row.Class ResultSet, boolean relative(int)The
refreshRow
method 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 callrefreshRow
when 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
refreshRow
is called after calling anupdateXXXupdater method but before calling the methodupdateRow
then the updates made to the row are lost. Calling the methodrefreshRow
frequently 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
Moves 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. CallingClass ResultSet, boolean rowDeleted()relative(0)
is valid but does not change the cursor position.Note: Calling the method
relative(1)
isdifferent fromidentical to calling the methodnext()
because is makesandsense to callcalling the method
nextrelative(-1)when there is no currentis identical to calling therowmethodprevious()
. @param rowsforanexampleint
whenspecifying thecursornumberis positionedof rowsbeforeto move from thefirstcurrent row;oraafterpositive number moves thelastcursorrowforward;ofa negative number moves theresultcursorset.backward @returntrue
if the cursor is on a row;false
otherwise @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()IndicatesRetrieves 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 not thisResultSet
object can detect deletions. @returntrue
if a row was deleted and deletions are detected;false
otherwise @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()IndicatesRetrieves whether the current row has had an insertion. The value returned depends on whether or not thisResultSet
object can detect visible inserts. @returntrue
if a row has had an insertion and insertions are detected;false
otherwise @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)IndicatesRetrieves whether the current row has been updated. The value returned depends on whether or not the result set can detect updates. @returntrue
if both (1) the row has been visibly updated by the owner or another and (2) 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
Gives a hint as to the direction in which the rows in thisClass ResultSet, void setFetchSize(int)ResultSet
object will be processed. The initial value is determined by theStatement
object that produced thisResultSet
object. The fetch direction may be changed at any time. @param direction anint
specifying the suggested fetch direction; one ofResultSet.FETCH_FORWARD
ResultSet.FETCH_REVERSE
orResultSet.FETCH_UNKNOWN
@exception SQLException if a database access error occurs or the result set type isTYPE_FORWARD_ONLY
and the fetch direction is notFETCH_FORWARD
@since 1.2 @seeWhat Is in the JDBC 2.0 APIStatement#setFetchDirection @seeStatement#setFetchDirectiongetFetchDirection
Gives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed for thisClass ResultSet, void updateAsciiStream(String, InputStream, int)ResultSet
object. 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 theStatement
object 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 @seeWhat Is in the JDBC 2.0 API#getFetchSize
Updates the designated column with an ascii stream value. TheClass ResultSet, void updateAsciiStream(int, InputStream, int)updateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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
Updates the designated column with an ascii stream value. TheClass ResultSet, void updateBigDecimal(String, BigDecimal)updateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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
Updates the designated column with aClass ResultSet, void updateBigDecimal(int, BigDecimal)java.sql.BigDecimal
value. TheupdateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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
Updates the designated column with aClass ResultSet, void updateBinaryStream(String, InputStream, int)java.math.BigDecimal
value. TheupdateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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 a binary stream value. TheClass ResultSet, void updateBinaryStream(int, InputStream, int)updateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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
Updates the designated column with a binary stream value. TheClass ResultSet, void updateBoolean(String, boolean)updateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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
Updates the designated column with aClass ResultSet, void updateBoolean(int, boolean)boolean
value. TheupdateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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
Updates the designated column with aClass ResultSet, void updateByte(String, byte)boolean
value. TheupdateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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 updateByte(int, byte)byte
value. TheupdateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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
Updates the designated column with aClass ResultSet, void updateBytes(String, byte[])byte
value. TheupdateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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[])boolean value. The updateXXX methods are used to update column values in the current row or the insert row. The updateXXX methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the database. JDBC 2.0 Updates a column with abyte array value. TheupdateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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
Updates the designated column with aClass ResultSet, void updateCharacterStream(String, Reader, int)byte
array value. TheupdateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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 a character stream value. TheClass ResultSet, void updateCharacterStream(int, Reader, int)updateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods are called to update the database. @param columnName the name of the column @paramxreader thejava.io.Reader
object containing 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
Updates the designated column with a character stream value. TheClass ResultSet, void updateDate(String, Date)updateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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
Updates the designated column with aClass ResultSet, void updateDate(int, Date)java.sql.Date
value. TheupdateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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
Updates the designated column with aClass ResultSet, void updateDouble(String, double)java.sql.Date
value. TheupdateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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 updateDouble(int, double)double
value. TheupdateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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
Updates the designated column with aClass ResultSet, void updateFloat(String, float)double
value. TheupdateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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 updateFloat(int, float)float
value. TheupdateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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
Updates the designated column with aClass ResultSet, void updateInt(String, int)float
value. TheupdateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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 anClass ResultSet, void updateInt(int, int)int
value. TheupdateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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
Updates the designated column with anClass ResultSet, void updateLong(String, long)int
value. TheupdateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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 updateLong(int, long)long
value. TheupdateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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
Updates the designated column with aClass ResultSet, void updateNull(String)long
value. TheupdateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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 updateNull(int)null
value. TheupdateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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
Gives a nullable column a null value. TheClass ResultSet, void updateObject(String, Object)updateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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
Updates the designated column with anClass ResultSet, void updateObject(String, Object, int)Object
value. TheupdateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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
Updates the designated column with anClass ResultSet, void updateObject(int, Object)Object
value. TheupdateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods are called to update the database. @param columnName the name of the column @param x the new column value @param scale forjava.sql.Types.
orDECIMADECIMALjava.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 @since 1.2@see What Is in the JDBC 2.0 API
Updates the designated column with anClass ResultSet, void updateObject(int, Object, int)Object
value. TheupdateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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 anClass ResultSet, void updateRow()Object
value. TheupdateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods are called to update the database. @param columnIndex the first column is 1 the second is 2 ... @param x the new column value @param scale forjava.sql.Types.DECIMA
orjava.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 @since 1.2@see What Is in the JDBC 2.0 API
Updates the underlying database with the new contents of the current row of thisClass ResultSet, void updateShort(String, short)ResultSet
object. This 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
Updates the designated column with aClass ResultSet, void updateShort(int, short)short
value. TheupdateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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
Updates the designated column with aClass ResultSet, void updateString(String, String)short
value. TheupdateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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 updateString(int, String)String
value. TheupdateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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
Updates the designated column with aClass ResultSet, void updateTime(String, Time)String
value. TheupdateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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 updateTime(int, Time)java.sql.Time
value. TheupdateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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
Updates the designated column with aClass ResultSet, void updateTimestamp(String, Timestamp)java.sql.Time
value. TheupdateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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 updateTimestamp(int, Timestamp)java.sql.Timestamp
value. TheupdateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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
Updates the designated column with aClass ResultSet, boolean wasNull()java.sql.Timestamp
value. TheupdateXXXupdater methods are used to update column values in the current row or the insert row. TheupdateXXXupdater methods do not update the underlying database; instead theupdateRow
orinsertRow
methods 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 thegetXXXgetter methods on a column to try to read its value and then call the methodwasNull
to see if the value read was SQLNULL
. @returntrue
if the last column value read was SQLNULL
andfalse
otherwise @exception SQLException if a database access error occurs
The constant indicating the concurrency mode for aClass ResultSet, int CONCUR_UPDATABLEResultSet
object that may NOT be updated. @since 1.2@see What Is in the JDBC 2.0 API
The constant indicating the concurrency mode for aClass ResultSet, int FETCH_FORWARDResultSet
object that may be updated. @since 1.2@see What Is in the JDBC 2.0 API
The constant indicating that the rows in a result set will be processed in a forward direction; first-to-last. This constant is used by the methodClass ResultSet, int FETCH_REVERSEsetFetchDirection
as a hint to the driver which the driver may ignore. @since 1.2@see What Is in the JDBC 2.0 API
The constant indicating that the rows in a result set will be processed in a reverse direction; last-to-first. This constant is used by the methodClass ResultSet, int TYPE_FORWARD_ONLYsetFetchDirection
as a hint to the driver which the driver may ignore. @since 1.2@see What Is in the JDBC 2.0 API
The constant indicating the type for aClass ResultSet, int TYPE_SCROLL_INSENSITIVEResultSet
object whose cursor may move only forward. @since 1.2@see What Is in the JDBC 2.0 API
The constant indicating the type for aClass ResultSet, int TYPE_SCROLL_SENSITIVEResultSet
object that is scrollable but generally not sensitive to changes made by others. @since 1.2@see What Is in the JDBC 2.0 API
The constant indicating the type for aResultSet
object that is scrollable and generally sensitive to changes made by others. @since 1.2@see What Is in the JDBC 2.0 API
Gets the designated column's table's catalog name. @param column the first column is 1 the second is 2 ... @returnClass ResultSetMetaData, String getColumnClassName(int)columnthe name of the catalog for the table in which the given column appears or "" if not applicable @exception SQLException if a database access error occurs
Returns the fully-qualified name of the Java class whose instances are manufactured if the method
ResultSet.getObject
is called to retrieve a value from the column.ResultSet.getObject
may return a subclass of the class returned by this method. @param column the first column is 1 the second is 2 ... @return the fully-qualified name of the class in the Java programming language that would be used by the methodResultSet.getObject
to 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
The interface used for the custom mapping of an SQL user-definedClass SQLData, String getSQLTypeName()typestype (UDT) to a class in the Java programming language.ThisThe class object for a class implementing theSQLData
interfacemustwill beimplementedenteredby any Javain the appropriateclassConnection
object'sthattype map along with the SQL name of the UDT for which it isregisteredaincustom mapping.Typically a
a field for each attribute of an SQL structured typeSQLData
implementation will definemappingor a single field for an SQLDISTINCT
type. When the UDT is retrieved from a data source with theResultSet.getObject
method it will be mapped as an instance of this class. A programmer can operate on this class instance just as on any other object in the Java programming language and then store any changes made to it by calling thePreparedStatement.setObject
method which will map it back to the SQL type.It is expected that
this interface willthe implementation ofnormallythe class for a custom mapping will beimplementeddone by a tool. In a typical implementation the programmer would simply supply the name of the SQL UDT the name of the class to which it is being mapped and the names of the fields to which each of the attributes of the UDT is to be mapped. Themethodstoolinwill use thisinterface are calledinformation to implementbytheSQLData.readSQL
andSQLData.writeSQL
methods. ThereadSQL
method calls thedriverappropriateSQLInput
methods to read each attribute from anSQLInput
object andaretheneverwriteSQL
called bymethod callsaSQLOutput
programmermethodsdirectly.to@sincewrite1each attribute back to the data source via anSQLOutput
object.2@see
WhatAnIsapplicationinprogrammer will not normally callSQLData
methods directly and theJDBCSQLInput
2andSQLOutput
methods are called internally bySQLData
methods not by application code.0@sinceAPI1.2
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
. @return the type name that was passed to the methodreadSql
when 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)The JDBC driver initializes the input stream with a type map before calling this method which is used by the appropriate
- 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 method
readSQL
then assigns the data to appropriate fields or elements (of this or other objects). Specifically it must call the appropriate reader method (SQLInput.readString
SQLInput.
and so on) method(s) to do the following: for a distinct type read its single data element; for a structured type read a value for each attribute of the SQL type.readXXXreadBigDecimalSQLInput
reader method on the stream. @param stream the.readXXXSQLInput
object from which to read the data for the value that is being custom mapped @param typeName 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
writer method(s) (.writeXXXwriteInt
writeString
and so on) 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 theSQLOutput
object to which to write the data for 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
SQLException
provides 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 either the XOPEN SQLstate conventions or the SQL 99 conventions. The values of the SQLState string are described in the appropriate spec. The
DatabaseMetaData
methodgetSQLStateType
can be used to discover whether the driver returns the XOPEN type or the SQLspec99 type.- 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)SQLException
object; thereason field defaults to null the
SQLState field defaults to
null
and thevendorCode field defaults to 0.
Constructs anClass SQLException, constructor SQLException(String, String)SQLException
object with a reason; theSQLState field defaults to
null
and thevendorCode field defaults to 0. @param reason a description of the exception
Constructs anClass SQLException, constructor SQLException(String, String, int)SQLException
object withathe given reason and SQLState; thevendorCode field defaults to 0. @param reason a description of the exception @param SQLState an XOPEN or SQL 99 code identifying the exception
Constructs a fully-specified SQLException
object. @param reason a description of the exception @param SQLState an XOPEN or SQL 99 code identifying the exception @param vendorCode a database vendor-specific exception code
Class SQLException, SQLException getNextException()Retrieves the exception chained to thisClass SQLException, void setNextException(SQLException)SQLException
object. @return the nextSQLException
object in the chain;null
if there are none @see #setNextException
Adds anSQLException
object to the end of the chain. @param ex the new exception that will be added to the end of theSQLException
chain @see #getNextException
An input stream that contains a stream of values representing an instance of an SQL structured type or an SQL distinct type. This interface used only for custom mapping is used by the driver behind the scenes and a programmer never directly invokesClass SQLInput, InputStream readAsciiStream()SQLInput
methods. The reader methods (
readXXXreadLongmethodsreadBytes
and so on) provide a way to read the values in anSQLInput
object. The methodwasNull
is used to determine whether the the last value read was SQLNULL
.When the method
getObject
is called with an object of a class implementing the interfaceSQLData
the JDBC driver calls the methodSQLData.getSQLType
to determine the SQL type of the user-defined type (UDT) being custom mapped. The driver creates an instance ofSQLInput
populating it with the attributes of the UDT. The driver then passes the input stream to the methodSQLData.readSQL
which in turn calls theSQLInput
reader methods in its implementation for reading the attributes from the input stream. @since 1.2.readXXX@see What Is in the JDBC 2.0 API
Class SQLInput, BigDecimal readBigDecimal()ReturnsReads the next attribute in the stream and returns it as a stream of ASCII characters. @return the attribute; if the value is SQLNULL
returnsnull
@exception SQLException if a database access error occurs
Reads the next attribute in the stream and returns it as aClass SQLInput, InputStream readBinaryStream()java.math.BigDecimal
object in the Java programming language. @return the attribute; if the value is SQLNULL
returnsnull
@exception SQLException if a database access error occurs
Class SQLInput, boolean readBoolean()ReturnsReads the next attribute in the stream and returns it as a stream of uninterpreted bytes. @return the attribute; if the value is SQLNULL
returnsnull
@exception SQLException if a database access error occurs
Reads the next attribute in the stream and returns it as aClass SQLInput, byte readByte()boolean
in the Java programming language. @return the attribute; if the value is SQLNULL
returnsfalse
@exception SQLException if a database access error occurs
Reads the next attribute in the stream and returns it as aClass SQLInput, byte[] readBytes()byte
in the Java programming language. @return the attribute; if the value is SQLNULL
returns0
@exception SQLException if a database access error occurs
Reads the next attribute in the stream and returns it as an array of bytes in the Java programming language. @return the attribute; if the value is SQLClass SQLInput, Reader readCharacterStream()NULL
returnsnull
@exception SQLException if a database access error occurs
Class SQLInput, Date readDate()ReturnsReads the next attribute in the stream and returns it as a stream of Unicode characters. @return the attribute; if the value is SQLNULL
returnsnull
@exception SQLException if a database access error occurs
Reads the next attribute in the stream and returns it as aClass SQLInput, double readDouble()java.sql.Date
object. @return the attribute; if the value is SQLNULL
returnsnull
@exception SQLException if a database access error occurs
Reads the next attribute in the stream and returns it as aClass SQLInput, float readFloat()double
in the Java programming language. @return the attribute; if the value is SQLNULL
returns0
@exception SQLException if a database access error occurs
Reads the next attribute in the stream and returns it as aClass SQLInput, int readInt()float
in the Java programming language. @return the attribute; if the value is SQLNULL
returns0
@exception SQLException if a database access error occurs
Reads the next attribute in the stream and returns it as anClass SQLInput, long readLong()int
in the Java programming language. @return the attribute; if the value is SQLNULL
returns0
@exception SQLException if a database access error occurs
Reads the next attribute in the stream and returns it as aClass SQLInput, Object readObject()long
in the Java programming language. @return the attribute; if the value is SQLNULL
returns0
@exception SQLException if a database access error occurs
Class SQLInput, short readShort()ReturnsReads the datum at the head of the stream and returns it as anObject
in the Java programming 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
NULL
the 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.readSQL
on 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 as anObject
in the Java programming language;null
if the datum is SQLNULL
@exception SQLException if a database access error occurs
Reads the next attribute in the stream and returns it as aClass SQLInput, String readString()short
in the Java programming language. @return the attribute; if the value is SQLNULL
returns0
@exception SQLException if a database access error occurs
Reads the next attribute in the stream and returns it as aClass SQLInput, Time readTime()String
in the Java programming language. @return the attribute; if the value is SQLNULL
returnsnull
@exception SQLException if a database access error occurs
Reads the next attribute in the stream and returns it as aClass SQLInput, Timestamp readTimestamp()java.sql.Time
object. @return the attribute; if the value is SQLNULL
returnsnull
@exception SQLException if a database access error occurs
Reads the next attribute in the stream and returns it as aClass SQLInput, boolean wasNull()java.sql.Timestamp
object. @return the attribute; if the value is SQLNULL
returnsnull
@exception SQLException if a database access error occurs
DeterminesRetrieves whether the last value read was SQLNULL
. @returntrue
if the most recently read SQL value was SQLNULL
;otherwisefalse
otherwise @exception SQLException if a database access error occurs
The 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.Class SQLOutput, void writeObject(SQLData)When an object of a class implementing the interface
SQLData
is passed as an argument to an SQL statement the JDBC driver calls the methodSQLData.getSQLType
to determine the kind of SQL datum being passed to the database. The driver then creates an instance ofSQLOutput
and passes it to the methodSQLData.writeSQL
. The methodwriteSQL
in turn calls the appropriateSQLOutput
writer methods.writeXXXwriteBoolean
writeCharacterStream
and so on) to write data from theSQLData
object to theSQLOutput
output stream as the representation of an SQL user-defined type. @since 1.2@see What Is in the JDBC 2.0 API
Writes to the stream the data contained in the givenSQLData
object. When theSQLData
object isnull
this method writes an SQLNULL
to the stream. Otherwise it calls theSQLData.writeSQL
method of the given object which writes the object's attributes to the stream. The implementation of the methodSQLData.writeSQ
calls the appropriateSQLOutput
writer method(s) for writing each of the object's attributes in order. The attributes must be read from an.writeXXXSQLInput
input stream and written to anSQLOutput
output 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
The permission for which theSecurityManager
will check when code that is running in an applet callsone oftheDriverManager.setLogWriter
methods. These methods include thosemethodinor thefollowing list. DriverManager.setLogWriterDriverManager.setLogStream
(deprecated)javax.sql.DataSource.setLogWriter javax.sql.ConnectionPoolDataSource.setLogWriterjavax.sql.XADataSourcemethod.setLogWriterIf there is noSQLPermission
objectthis method throwsthese methods throw ajava.lang.SecurityException
as a runtime exception.A
SQLPermission
object contains a name (also referred to as a "target name") but no actions list; there is either a named permission or there is not. The target name is the name of the permission (see below). The naming convention follows the hierarchical property naming convention. In addition an asterisk may appear at the end of the name following a "." or by itself to signify a wildcard match. For example:loadLibrary.*
or*
is valid but*loadLibrary
ora*b
is not valid.The following table lists all the possible
SQLPermission
target names. Currently the only name allowed issetLog
. The table gives a description of what the permission allows and a discussion of the risks of granting code the permission.
The person running an applet decides what permissions to allow and will run the
Permission Target Name What the Permission Allows Risks of Allowing this Permission setLog Setting of the logging stream This is a dangerous permission to grant. The contents of the log may contain usernames and passwords SQL statements and SQL data. Policy Tool
to create anSQLPermission
in a policy file. A programmer does not use a constructor directly to create an instance ofSQLPermission
but rather uses a tool. @since 1.3 @see java.security.BasicPermission @see java.security.Permission @see java.security.Permissions @see java.security.PermissionCollection @see java.lang.SecurityManager
Class SQLWarning, constructor SQLWarning(String)An exception that provides information on database access warnings. Warnings are silently chained to the object whose method caused it to be reported.
Warnings may be retrieved from
Connection
Statement
andResultSet
objects. Trying to retrieve a warning on a connection after it has been closed will cause an exception to be thrown. Similarly trying to retrieve a warning on a statement after it has been closed or on a result set after it has been closed will cause an exception to be thrown. Note that closing a statement also closes a result set that it might have produced. @see Connection#getWarnings @see Statement#getWarnings @see ResultSet#getWarnings
Constructs anClass SQLWarning, constructor SQLWarning(String, String)SQLWarning
object with the given value for a reason;SQLStateSQLstate defaults tonull
and vendorCode defaults to 0. @param reason a description of the warning
Constructs anClass SQLWarning, constructor SQLWarning(String, String, int)SQLWarning
object with the given reason and SQLState; the vendorCode defaults to 0. @param reason a description of the warning @paramSQLStateSQLstate an XOPEN code identifying the warning
Constructs a fully-specifiedClass SQLWarning, SQLWarning getNextWarning()SQLWarning
object initialized with the given values. @param reason a description of the warning @paramSQLStateSQLstate an XOPEN code identifying the warning @param vendorCode a database vendor-specific warning code
Retrieves the warning chained to thisClass SQLWarning, void setNextWarning(SQLWarning)SQLWarning
object. @return the nextSQLException
in the chain;null
if none @see #setNextWarning
Adds anSQLWarning
object to the end of the chain. @param w the new end of theSQLException
chain @see #getNextWarning
Class Statement, void addBatch(String)The object used for executing a static SQL statement and
obtainingreturning the resultsproduced byit produces.
OnlyBy default only oneResultSet
object perStatement
object can be open atany pointtheinsame time. Therefore if the reading of oneResultSet
object is interleaved with the reading of another each must have been generated by differentStatement
objects. Allstatementexecution methods in the
executeStatementmethodsinterface implicitly close a statment's currentResultSet
object if an open one exists. @see Connection#createStatement @see ResultSet
AddsClass Statement, void clearBatch()anthe given SQL command to the currentbatchlist of commmands for thisStatement
object. The commands in this list can be executed as a batch by calling the methodexecuteBatch
.NOTE:
This method is optional. @param sql typically this is a static SQLINSERT
orUPDATE
statement @exception SQLException if a database access error occurs or the driver does not support batchstatements @since 1.2updates @seeWhat Is in the#executeBatchJDBC@since21.0 API2
Class Statement, void close()MakesEmptiesthe setthisofStatement
commandsobject'sin the current batch emptycurrent list of SQL commands.NOTE: This method is optional. @exception SQLException if a database access error occurs or the driver does not support batch
statements @since 1.2updates @seeWhat Is in the#addBatchJDBC@since21.0 API2
Releases thisClass Statement, boolean execute(String)Statement
object'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.Calling the method
close
on aStatement
object that is already closed has no effect.Note: A
Statement
object is automatically closed when it is garbage collected. When aStatement
object is closed its currentResultSet
object if one exists is also closed. @exception SQLException if a database access error occurs
ExecutesClass Statement, int[] executeBatch()anthe given SQL statementthatwhich may return multiple results.UnderIn 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 methods execute getMoreResults getResultSet and getUpdateCount let you navigate
through multiple results.Theexecute
method executes an SQL statement and indicates the form of the first result. Youcanmust then use the methodsgetResultSet
orgetUpdateCount
to retrieve the result andgetMoreResults
to move to any subsequent result(s). @param sql any SQL statement @returntrue
if thenextfirst result is aResultSet
object;false
if it is an update count or there are nomoreresults @exception SQLException if a database access error occurs @see #getResultSet @see #getUpdateCount @see #getMoreResults
Submits a batch of commands to the database for execution and if all commands execute successfully returns an array of update counts. TheClass Statement, ResultSet executeQuery(String)int
elements 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 methodexecuteBatch
may 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
-- indicates that the command was processed successfully but that the number of rows affected is unknown
-2SUCCESS_NO_INFOIf one of the commands in a batch update fails to execute properly this method throws a
BatchUpdateException
and 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 commands. If the driver continues processing after a failure the array returned by the methodBatchUpdateException.getUpdateCounts
will 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
-- indicates that the command failed to execute successfully and occurs only if a driver continues to process commands after a command fails
-3EXECUTE_FAILEDA driver is not 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 a
BatchUpdateException
obejct has been thrown. @return an array of update counts containing one element for each command in the batch. The elements of the array are ordered according to the order in which commands were added to 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)anthe given SQL statementthatwhich returns a singleResultSet
object. @param sqltypicallyan SQL statementthis isto be sent to the database typically a static SQLSELECT
statement @return aResultSet
object that contains the data produced by the given query; nevernull
@exception SQLException if a database access error occurs or the given SQL statement produces anything other than a singleResultSet
object
ExecutesClass Statement, Connection getConnection()anthe given SQL statement which may be anINSERT
UPDATE
orDELETE
statement.In additionor an SQLstatementsstatement thatreturnreturns nothing such as an SQL DDLstatements can be executedstatement. @param sql an SQLINSERT
UPDATE
orDELETE
statement or an SQL statement that returns nothing @return either the row count forINSERT
UPDATE
orDELETE
statements or0
for SQL statements that return nothing @exception SQLException if a database access error occurs or the given SQL statement produces aResultSet
object
Class Statement, int getFetchDirection()ReturnsRetrieves theConnection
object that produced thisStatement
object. @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
Retrieves the direction for fetching rows from database tables that is the default for result sets generated from thisClass Statement, int getFetchSize()Statement
object. If thisStatement
object has not set a fetch direction by calling the methodsetFetchDirection
the return value is implementation-specific. @return the default fetch direction for result sets generated from thisStatement
object @exception SQLException if a database access error occurs @since 1.2 @seeWhat Is in the JDBC 2.0 API#setFetchDirection
Retrieves the number of result set rows that is the default fetch size forClass Statement, int getMaxFieldSize()resultResultSet
setsobjects generated from thisStatement
object. If thisStatement
object has not set a fetch size by calling the methodsetFetchSize
the return value is implementation-specific. @return the default fetch size for result sets generated from thisStatement
object @exception SQLException if a database access error occurs @since 1.2 @seeWhat Is in the JDBC 2.0 API#setFetchSize
Class Statement, int getMaxRows()ReturnsRetrieves the maximum number of bytesallowed for anythatcolumncanvalue.beThis limit is the maximum number of bytes thatreturned for character and binary column values in acanResultSet
be returned for anyobject produced by thiscolumnStatement
valueobject.TheThis limit applies only toBINARY
VARBINARY
LONGVARBINARY
CHAR
VARCHAR
andLONGVARCHAR
columns. If the limit is exceeded the excess data is silently discarded. @return the currentmaxcolumn size limit for columns storing character and binary values; zero meansunlimitedthere is no limit @exception SQLException if a database access error occurs @see #setMaxFieldSize
Retrieves the maximum number of rows that aClass Statement, boolean getMoreResults()ResultSet
object produced by thisStatement
object can contain. Ifthethis limit is exceeded the excess rows are silently dropped. @return the currentmaxmaximum numberrowoflimitrows for aResultSet
object produced by thisStatement
object; zero meansunlimitedthere is no limit @exception SQLException if a database access error occurs @see #setMaxRows
Moves toClass Statement, int getQueryTimeout()athisStatement
object's next result. Itreturnstrue
ifthis resultit is aResultSet
object. This methodalsoand implicitly closes any currentResultSet
object(s) obtained with the methodgetResultSet
.There are no more results when the following is true:
@return( getMoreResults() && (getUpdateCount() == -1)
true
if the next result is aResultSet
object;false
if 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()Statement
object to execute. If the limit is exceeded aSQLException
is thrown. @return the current query timeout limit in seconds; zero meansunlimitedthere is no limit @exception SQLException if a database access error occurs @see #setQueryTimeout
Class Statement, int getResultSetConcurrency()ReturnsRetrieves the current result as aResultSet
object. This method should be called only once per result. @return the current result as aResultSet
object;ornull
if the result is an update count or there are no more results @exception SQLException if a database access error occurs @see #execute
Retrieves the result set concurrency forClass Statement, int getResultSetType()ResultSet
objects generated by thisStatement
object. @return eitherResultSet.CONCUR_READ_ONLY
orResultSet.CONCUR_UPDATABLE
@sinceexception1.2SQLException@seeifWhataIs in the JDBCdatabase access error occurs2.0@sinceAPI1.2
Retrieves the result set type forClass Statement, int getUpdateCount()ResultSet
objects generated by thisStatement
object. @return one ofResultSet.TYPE_FORWARD_ONLY
ResultSet.TYPE_SCROLL_INSENSITIVE
orResultSet.TYPE_SCROLL_SENSITIVE
@sinceexception1.2SQLException@seeifWhataIs in the JDBCdatabase access error occurs2.0@sinceAPI1.2
Class Statement, SQLWarning getWarnings()ReturnsRetrieves the current result as an update count; if the result is aResultSet
object 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 if the current result is aResultSet
object 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)Statement
object. SubsequentStatement
object warnings will be chained to thisSQLWarning
object.The warning chain is automatically cleared each time a statement is (re)executed. This method may not be called on a closed
Statement
object; doing so will cause anSQLException
to be thrown.Note: If you are processing a
ResultSet
object any warnings associated with reads on thatResultSet
object will be chained on it rather than on theStatement
object that produced it. @return the firstSQLWarning
object ornull
if there are no warnings @exception SQLException if a database access error occurs or this method is called on a closed statement
Class Statement, void setEscapeProcessing(boolean)DefinesSets the SQL cursor namethatto the givenString
which will be used by subsequentStatement
objectexecute
methods. This name can then be used in SQL positioned update/or delete statements to identify the current row in theResultSet
object generated by this statement. If the databasedoesn'tdoes not support positioned update/delete this method is a noop. To insure that a cursor has the proper isolation level to support updates the cursor'sSELECT
statement shouldbe ofhave the form'select forSELECT
. IfupdateFOR...'UPDATEthe 'for update'FOR
isphraseUPDATEomittednot present positioned updates may fail.Note: By definition the execution of positioned
update/deleteupdatesexecutionand deletes must be done by a differentStatement
object than the onewhichthat generated theResultSet
object 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 statement to the database. Note: Since prepared statements have usually been parsed prior to making this call disabling escape processing forClass Statement, void setFetchDirection(int)preparedPreparedStatements
statementsobjects will have no effect. @param enabletrue
to enable escape processing;false
to disable it @exception SQLException if a database access error occurs
Gives the driver a hint as to the direction in whichClass Statement, void setFetchSize(int)therowsin a result setwill be processed. The hint appliesonly toinresultResultSet
setsobjects created using thisStatement
object. The default value isResultSet.FETCH_FORWARD
.Note that this method sets the default fetch direction for result sets generated by this
Statement
object. 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_FORWARD
ResultSet.FETCH_REVERSE
orResultSet.FETCH_UNKNOWN
@since 1.2 @seeWhat Is in the JDBC 2.0 API#getFetchDirection
Gives 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 <Class Statement, void setMaxFieldSize(int)rows
<this.getMaxRows()
is not satisfied. @since 1.2 @seeWhat Is in the JDBC 2.0 API#getFetchSize
Sets the limit for the maximum number of bytes in aClass Statement, void setMaxRows(int)column toResultSet
the given number ofcolumn storing character orbytes.binaryThis isvalues to themaximumgiven number of bytesthat can be returned for any column value. This limit applies only toBINARY
VARBINARY
LONGVARBINARY
CHAR
VARCHAR
andLONGVARCHAR
fields. If the limit is exceeded the excess data is silently discarded. For maximum portability use values greater than 256. @param max the newmaxcolumn size limit in bytes; zero meansunlimitedthere is no limit @exception SQLException if a database access error occurs or the condition max >= 0 is not satisfied @see #getMaxFieldSize
Sets the limit for the maximum number of rows that anyClass Statement, void setQueryTimeout(int)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 meansunlimitedthere is no limit @exception SQLException if a database access error occurs or the condition max >= 0 is not satisfied @see #getMaxRows
Sets the number of seconds the driver will wait for aStatement
object to execute to the given number of seconds. If the limit is exceeded anSQLException
is thrown. @param seconds the new query timeout limit in seconds; zero meansunlimitedthere is no limit @exception SQLException if a database access error occurs or the condition seconds >= 0 is not satisfied @see #getQueryTimeout
Class Struct, String getSQLTypeName()The standard mapping in the Java programming language for an SQL structured type. A
Struct
object contains a value for each attribute of the SQL structured type that it represents. By default an instance ofStruct
is valid as long as the application has a reference to it. @since 1.2@see What Is in the JDBC 2.0 API
Retrieves the SQL type name of the SQL structured type that thisStruct
object represents. @returnsreturn the fully-qualified type name of the SQL structured type for which thisStruct
object is the generic representation @exception SQLException if a database access error occurs
Class Time, constructor Time(int, int, int)A thin wrapper around the
java.util.Date
class that allows the JDBC API to identify this asaan SQLTIME
value. TheTime
class 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()Time
object 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 aTime
object will throw ajava.lang.IllegalArgumentException
.The result is undefined if a given argument is out of bounds. @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 SQL TIME
values do not have a date component. @deprecated @exception java.lang.IllegalArgumentException if this method is invoked @see #setDate
Class Time, int getMonth()This method is deprecated and should not be used because SQL TIME
values do not have a month component. @deprecated @exception java.lang.IllegalArgumentException if this method is invoked @see #setMonth
Class Time, int getYear()This method is deprecated and should not be used because SQL TIME
values do not have a year component. @deprecated @exception java.lang.IllegalArgumentException if this method is invoked @see #setYear
Class Time, void setDate(int)This method is deprecated and should not be used because SQL TIME
values do not have a date component. @deprecated @exception java.lang.IllegalArgumentException if this method is invoked @see #getDate
Class Time, void setMonth(int)This method is deprecated and should not be used because SQL TIME
values do not have a month component. @deprecated @exception java.lang.IllegalArgumentException if this method is invoked @see #getMonth
Class Time, void setYear(int)This method is deprecated and should not be used because SQL TIME
values do not have a year component. @deprecated @exception java.lang.IllegalArgumentException if this method is invoked @see #getYear
Class Time, String toString()Formats a time in JDBCClass Time, Time valueOf(String)datetime escape format. @return aString
in hh:mm:ss format @overrides java.util.Date.toString
Converts a string in JDBC time escape format to aTime
value. @param s time in format "hh:mm:ss" @return a correspondingTime
object @overrides java.util.Date.valueOf
Constructs aClass Timestamp, constructor Timestamp(long)Timestamp
object initialized with the given values. @param year the year-minus 1900 @param month 0 to 11 @param date 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)
@exception IllegalArgumentException if the nano argument is out of bounds
Constructs aClass Timestamp, boolean equals(Object)Timestamp
object using a milliseconds time value. The integral seconds are stored in the underlying date value; the fractional seconds are stored in thenanos
field of theTimestamp
object. @param time milliseconds since January 1 1970 00:00:00 GMT. A negative number is the number of milliseconds before January 1 1970 00:00:00 GMT. @see java.util.Calendar for more information
Tests to see if thisClass Timestamp, boolean equals(Timestamp)Timestamp
object is equal to the given object. This version of the methodequals
has 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 theObject
value to compare with @returntrue
if the givenObject
instance is equal to thisTimestamp
object;false
otherwise
Tests to see if thisClass Timestamp, int getNanos()Timestamp
object is equal to the givenTimestamp
object. @param ts theTimestamp
value to compare with @returntrue
if the givenTimestamp
object is equal to thisTimestamp
object;false
otherwise
Gets thisClass Timestamp, long getTime()Timestamp
object'snanos
value. @return thisTimestamp
object's fractional seconds component @see #setNanos
Returns the number of milliseconds since January 1 1970 00:00:00 GMT represented by thisClass Timestamp, void setNanos(int)DateTimestamp
object. @return the number of milliseconds since January 1 1970 00:00:00 GMT represented by this date. @see #setTime
Sets thisClass Timestamp, void setTime(long)Timestamp
object'snanos
field 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 @see #getNanos
Sets thisDateTimestamp
object to represent a point in time that is time milliseconds after January 1 1970 00:00:00 GMT. @param time the number of milliseconds. @see #getTime @see #Timestamp(long time) @see java.util.Calendar for more information
The constant in the Java programming language sometimes referred to as a type code that identifies the generic SQL typeClass Types, int BLOBARRAY
. @since 1.2@see What Is in the JDBC 2.0 API
The constant in the Java programming language sometimes referred to as a type code that identifies the generic SQL typeClass Types, int CLOBBLOB
. @since 1.2@see What Is in the JDBC 2.0 API
The constant in the Java programming language sometimes referred to as a type code that identifies the generic SQL typeClass Types, int DISTINCTCLOB
. @since 1.2@see What Is in the JDBC 2.0 API
The constant in the Java programming language sometimes referred to as a type code that identifies the generic SQL typeClass Types, int JAVA_OBJECTDISTINCT
. @since 1.2@see What Is in the JDBC 2.0 API
The constant in the Java programming language sometimes referred to as a type code that identifies the generic SQL typeClass Types, int REFJAVA_OBJECT
. @since 1.2@see What Is in the JDBC 2.0 API
The constant in the Java programming language sometimes referred to as a type code that identifies the generic SQL typeClass Types, int STRUCTREF
. @since 1.2@see What Is in the JDBC 2.0 API
The constant in the Java programming language sometimes referred to as a type code that identifies the generic SQL typeSTRUCT
. @since 1.2@see What Is in the JDBC 2.0 API