db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Hillegas (JIRA)" <derby-...@db.apache.org>
Subject [jira] Commented: (DERBY-944) Code ROWID methods for JDBC4 support
Date Mon, 13 Feb 2006 18:34:44 GMT
    [ http://issues.apache.org/jira/browse/DERBY-944?page=comments#action_12366226 ] 

Rick Hillegas commented on DERBY-944:
-------------------------------------

Here is section 19 of the JDBC 4 spec:

175
This chapter describes the RowId data type that represents the SQL ROWID value in
the Java programming language. A SQL ROWID is a built in type, as a value can be
thought of as an address for a row in a SQL database table.
19.1 Lifetime of RowId Validity
The address may be logical or physical, however this is determined by the originating data
source. A RowId object may be valid so long as the identified row is not deleted
and the lifetime of the RowId is within the bounds of the lifetime specified by that
RowId's data source.
RowId object lifetime valdity may be determined by calling the
DatabaseMetaData.getRowIdLifetime() method, which returns a value of the
RowIdLifetime enumerated data-type.
TABLE 19-1 Standard RowId life-time validities
RowIdLifeTime Enumerated Datatype Specification
ROWID_UNSUPPORTED Indicates that this data source does not support the
ROWID type.
ROWID_VALID_OTHER Indicates that the lifetime of a RowId from this data
source is implentation dependant.
176 JDBC 4.0 Specification • October 2005
19.2 Retrieving RowId Values
A RowId may be retrieved using the getter methods defined in ResultSet and
CallableStatement. The returned java.sql.RowId object that is returned is an
immutable object that can be used for subsequent referrals as a unique identifier to a
row.
java.sql.RowId rowId_1 = rs.getRowId(1);
CODE EXAMPLE 19-1 Retrieving a RowId for a ResultSet object, rs
19.3 Using RowId Values
A RowId value may be used in a parameterized PreparedStatement to set a
parameter with a RowId object.
Connection conn = ds.getConnection(user, passwd);
PreparedStatement ps = conn.prepareStatement("INSERT INTO BOOKLIST" +
"(ID, AUTHOR, TITLE, ISBN) VALUES (?, ?, ?,
?)");
ps.setRowId(1, rowId_1);
CODE EXAMPLE 19-2 Setting a PreparedStatement RowId parameter
A RowId value may also be used in an updatable ResultSet to update a column with
a specific RowId value.
ROWID_VALID_TRANSACTION Indicates that the lifetime of a RowId from this data
source is at least the containing transaction as long
as the identified row is not deleted.
ROWID_VALID_SESSION Indicates that the lifetime of a RowId from this data
source is at least the containing session as long as
the identified row is not deleted.
ROWID_VALID_FOREVER Indicates that the lifetime of a RowId from this data
source is, effectively, unlimited as long as the
identified row is not deleted.
TABLE 19-1 Standard RowId life-time validities
RowIdLifeTime Enumerated Datatype Specification
ResultSet rs = ...
rs.next();
rs.updateRowId(1, rowId_1);
CODE EXAMPLE 19-3 Setting a RowId value in the current row of a ResultSet
A RowId object value is typically not portable between data sources and should be
considered as specific to the data source when using the set or update method in
PreparedStatement and ResultSet objects respectively. It is therefore
inadvisable to use a RowId retrieved from a ResultSet object with a connection
'Foo' and then attempt to use the RowId in a unrelated ResultSet object with a
connection 'Bar'.

> Code ROWID methods for JDBC4 support
> ------------------------------------
>
>          Key: DERBY-944
>          URL: http://issues.apache.org/jira/browse/DERBY-944
>      Project: Derby
>         Type: New Feature
>   Components: JDBC
>     Reporter: Rick Hillegas
>      Fix For: 10.2.0.0

>
> As described in the JDBC4 spec sections 19 and 3.1.
> Derby does not support a stable ROWID datatype and we will not build this for release
10.2. The JDBC layer must report that Derby does not support this functionality. This involves
stubbing out the RowId methods in DatabaseMetaData, ResultSet, PreparedStatement, and CallableStatement.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message