db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <derby-...@db.apache.org>
Subject [jira] Commented: (DERBY-1393) PreparedStatement.setObject(Object,int,int) should throw for unsupported types
Date Tue, 04 Jul 2006 18:50:31 GMT
    [ http://issues.apache.org/jira/browse/DERBY-1393?page=comments#action_12419166 ] 

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

Hi Bryan,

1) The name of the test, (that is, the argument to org.apache.derbyTesting.functionTests.harness.RunTest)
is jdbc4/JDBC40TranslationTest.junit. The file that implements the test is called JDBC40TranslationTest.java.
The test harness uses the last part of the name to decide how it should run the test. If it
ends with ".java", the harness knows that the test is a java class with a main() method. If
it ends with ".junit", the harness knows it's a java class which can be run by a JUnit test
runner.

2) JDBC20Translation and JDBC30Translation are located in both org.apache.derby.iapi.reference
and org.apache.derby.shared.common.reference (the former used by the embedded driver and the
latter by the client driver). Since constants in an interface are compiled in by the compiler,
these interfaces need not be and are not part of the released jar files. The previous version
of JDBC40Translation was only located in org.apache.derby.shared.common.reference, and for
consistency (and because I needed the constants in the embedded driver) I created a copy in
org.apache.derby.iapi.reference. Instead of making a copy of the interface, I let it the new
interface extend the original one. This is also done by JDBC30Translation, and because of
the way the compiler handles constants in interfaces, there is no run-time dependency between
the two interfaces (actually, none of them exist at run-time).

> PreparedStatement.setObject(Object,int,int) should throw for unsupported types
> ------------------------------------------------------------------------------
>
>          Key: DERBY-1393
>          URL: http://issues.apache.org/jira/browse/DERBY-1393
>      Project: Derby
>         Type: Bug

>   Components: JDBC, SQL
>     Versions: 10.2.0.0
>  Environment: JDBC 4, jdk 1.6
>     Reporter: Dyre Tjeldvoll
>     Assignee: Knut Anders Hatlen
>     Priority: Minor
>      Fix For: 10.2.0.0
>  Attachments: derby-1393-v1.diff, derby-1393-v1.stat
>
> From the javadoc:
> Throws:
>  ...
>     SQLFeatureNotSupportedException - if targetSqlType is a ARRAY, BLOB, CLOB, DATALINK,
JAVA_OBJECT, NCHAR, NCLOB, NVARCHAR, LONGNVARCHAR, REF, ROWID, SQLXML or STRUCT data type
and the JDBC driver does not support this data type
> Since Derby doesn't support ARRAY, DATALINK, NCHAR, NCLOB, NVARCHAR, LONGNVARCHAR, REF,
ROWID, SQLXML or STRUCT the method should throw SQLFeatureNotSupportedException if used with
any of these types. Currently a general type conversion exception is thrown:
> >>1) testSetObjectNotImplementedARRAY(org.apache.derbyTesting.functionTests.tests.jdbc4.PreparedStatementTest)SQL
Exception: An attempt was made to get a data value of type 'CLOB' from a data value of type
'2003'.
> >>Caused by: SQL Exception: An attempt was made to get a data value of type 'CLOB'
from a data value of type '2003'.

-- 
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