db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-4869) Implement JDBC 4.1, the api increment introduced by Java 7
Date Thu, 23 Dec 2010 00:18:01 GMT

    [ https://issues.apache.org/jira/browse/DERBY-4869?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12974448#action_12974448
] 

Knut Anders Hatlen commented on DERBY-4869:
-------------------------------------------

Thanks, Rick. I agree that the ClassCastException doesn't provide much additional information
here.

One more issue: The catch clause in NetResultSet40 now catches all exceptions, not only ClassCastException,
which means it will handle all errors in the getters as conversion errors. Take this example:

        ResultSet rs = s.executeQuery("values cast ('abc' as clob)");
        while (rs.next()) {
            rs.getObject(1, Clob.class);
            rs.getObject(1, Clob.class);
        }

Here, the problem is that getClob() is called twice on the same column, but the error reported
is:

java.sql.SQLDataException: An attempt was made to get a data value of type 'java.sql.Clob'
from a data value of type 'CLOB'.

The real problem is also reported, but that's hidden further down in the exception chain:

...
Caused by: org.apache.derby.client.am.SqlException: An attempt was made to get a data value
of type 'java.sql.Clob' from a data value of type 'CLOB'.
...
Caused by: java.sql.SQLException: Stream or LOB value cannot be retrieved more than once
...

> Implement JDBC 4.1, the api increment introduced by Java 7
> ----------------------------------------------------------
>
>                 Key: DERBY-4869
>                 URL: https://issues.apache.org/jira/browse/DERBY-4869
>             Project: Derby
>          Issue Type: Improvement
>          Components: JDBC
>            Reporter: Rick Hillegas
>         Attachments: derby-4869-01-ac-rs-getObject.diff, derby-4869-01-ad-rs-getObject.diff,
derby-4869-02-aa-cs-ps-addBatch.diff, derby-4869-02-ab-cs-ps-addBatch.diff, derby-4869-03-aa-rs-getObject-errorCleanup.diff,
disable-tests.diff, JDBC_4.1_Changes.html
>
>
> This is a master issue logged to track our work implementing JDBC 4.1, the changes to
the java.sql and javax.sql packages introduced by Java 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message