You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Dyre Tjeldvoll (JIRA)" <de...@db.apache.org> on 2006/06/10 15:38:29 UTC

[jira] Created: (DERBY-1393) PreparedStatement.setObject(Object,int,int) should throw for unsupported types

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
    Priority: Minor
     Fix For: 10.2.0.0


>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


[jira] Updated: (DERBY-1393) PreparedStatement.setObject(Object,int,int) should throw for unsupported types

Posted by "Knut Anders Hatlen (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1393?page=all ]

Knut Anders Hatlen updated DERBY-1393:
--------------------------------------

    Derby Info: [Patch Available]

> 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


[jira] Updated: (DERBY-1393) PreparedStatement.setObject(int,Object,int) should throw SQLFeatureNotSupportedException for unsupported types

Posted by "Knut Anders Hatlen (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1393?page=all ]

Knut Anders Hatlen updated DERBY-1393:
--------------------------------------

    Summary: PreparedStatement.setObject(int,Object,int) should throw SQLFeatureNotSupportedException for unsupported types  (was: PreparedStatement.setObject(Object,int,int) should throw for unsupported types)

> PreparedStatement.setObject(int,Object,int) should throw SQLFeatureNotSupportedException 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


[jira] Updated: (DERBY-1393) PreparedStatement.setObject(Object,int,int) should throw for unsupported types

Posted by "Knut Anders Hatlen (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1393?page=all ]

Knut Anders Hatlen updated DERBY-1393:
--------------------------------------

    Attachment: derby-1393-v1.diff
                derby-1393-v1.stat

Attached a patch for this issue (derby-1393-v1.diff). Description of
the patch:

  The new setObject() methods call checkForSupportedDataType() to
  check whether targetSqlType is supported.

  Added a new error message "The data type ''{0}'' is not supported."
  with SQL state 0A000 (which ensures that the exception is converted
  to SQLFeatureNotSupportedException). This error message is used when
  targetSqlType is not supported.

  Added more JDBC 4.0 constants (from java.sql.Types) to
  JDBC40Translation and created a test JDBC40TranslationTest which
  tests that the constants are correct (the values of the constants
  are hard coded, so we don't get the compile-time check as with
  JDBC{2,3}0Translation).

  New test case SetObjectUnsupportedTest which is run as part of
  PreparedStatementTest and CallableStatementTest in the jdbc40 suite.

Derbyall runs cleanly. The patch is ready for review. Thanks!

> 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


[jira] Resolved: (DERBY-1393) PreparedStatement.setObject(int,Object,int) should throw SQLFeatureNotSupportedException for unsupported types

Posted by "Knut Anders Hatlen (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1393?page=all ]
     
Knut Anders Hatlen resolved DERBY-1393:
---------------------------------------

    Resolution: Fixed
    Derby Info:   (was: [Patch Available])

Thanks Bryan! Committed revision 420436.

> PreparedStatement.setObject(int,Object,int) should throw SQLFeatureNotSupportedException 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


[jira] Assigned: (DERBY-1393) PreparedStatement.setObject(Object,int,int) should throw for unsupported types

Posted by "Knut Anders Hatlen (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1393?page=all ]

Knut Anders Hatlen reassigned DERBY-1393:
-----------------------------------------

    Assign To: Knut Anders Hatlen

> 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

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


[jira] Commented: (DERBY-1393) PreparedStatement.setObject(Object,int,int) should throw for unsupported types

Posted by "Bryan Pendleton (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-1393?page=comments#action_12419720 ] 

Bryan Pendleton commented on DERBY-1393:
----------------------------------------

No, nothing more; the changes look good to me!

> 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


[jira] Commented: (DERBY-1393) PreparedStatement.setObject(Object,int,int) should throw for unsupported types

Posted by "Knut Anders Hatlen (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-1393?page=comments#action_12418457 ] 

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

Thanks for the info, Rick! Seems like setObject() with targetSqlType==JAVA_OBJECT should be supported too, then. For instance, this works:

    PreparedStatement ps = c.prepareStatement
        ("select aliasinfo from sys.sysaliases where aliasinfo = ?");
    ps.setObject(1, new org.apache.derby.catalog.AliasInfo() {
            public String getMethodName() {
                return "John Cleese";
            }
        });
    ps.executeQuery();

It should also work when targetSqlType is specified.

> 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

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


[jira] Commented: (DERBY-1393) PreparedStatement.setObject(Object,int,int) should throw for unsupported types

Posted by "Bryan Pendleton (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-1393?page=comments#action_12419159 ] 

Bryan Pendleton commented on DERBY-1393:
----------------------------------------

Hi Knut Anders, two questions from reading the patch:

1) is it JDBC40TranslationTest.java or JDBC40TranslationTest.junit? Parts of the
patch refer to the latter, but the patch appears to actually provide the former.

2) I don't understand this part; could you elaborate on what's going on here?

+/**
+ * This class is a refactoring wrapper around the shared
+ * JDBC40Translation class.
+ */
+public interface JDBC40Translation extends
+    org.apache.derby.shared.common.reference.JDBC40Translation {
+}



> 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


[jira] Commented: (DERBY-1393) PreparedStatement.setObject(Object,int,int) should throw for unsupported types

Posted by "Knut Anders Hatlen (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-1393?page=comments#action_12419689 ] 

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

Hi Bryan, did you have more comments to the patch? If not, I plan to commit it next week. Thanks!

> 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


[jira] Commented: (DERBY-1393) PreparedStatement.setObject(Object,int,int) should throw for unsupported types

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-1393?page=comments#action_12417821 ] 

Rick Hillegas commented on DERBY-1393:
--------------------------------------

The system catalogs contain object columns, which are Formatables:

sysaliases.aliasinfo
syschecks.referencedcolumn
syscolumns.columndatatype
syscolumns.columndefault
sysconglomerates.descriptor
sysdepends.dependentfinder
sysdepends.providerfinder
sysstatistics.statistics
systriggers.referencedcolumns

If you select these columns and call ResultSet.getObject(), you will see the following behavior:

1) Embedded: You get back the Formatable object that is stored in the column
2) Network and JCC: You get back the result of calling toString() on the Formatable


> 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

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


Re: [jira] Commented: (DERBY-1393) PreparedStatement.setObject(Object,int,int) should throw for unsupported types

Posted by Bryan Pendleton <bp...@amberpoint.com>.
> Instead of making a copy of the interface, I let it the new interface extend the original one.

Yes, I see; that is a good technique.

Thanks for the explanations.

bryan



[jira] Commented: (DERBY-1393) PreparedStatement.setObject(Object,int,int) should throw for unsupported types

Posted by "Knut Anders Hatlen (JIRA)" <de...@db.apache.org>.
    [ 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


[jira] Commented: (DERBY-1393) PreparedStatement.setObject(Object,int,int) should throw for unsupported types

Posted by "Dyre Tjeldvoll (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-1393?page=comments#action_12415888 ] 

Dyre Tjeldvoll commented on DERBY-1393:
---------------------------------------

Note that with the client driver NO exception is thrown when using this method with the unsupported types.

> 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
>     Priority: Minor
>      Fix For: 10.2.0.0

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


[jira] Commented: (DERBY-1393) PreparedStatement.setObject(Object,int,int) should throw for unsupported types

Posted by "Knut Anders Hatlen (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-1393?page=comments#action_12417760 ] 

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

Does Derby support JAVA_OBJECT? Types.JAVA_OBJECT is used in the code, but I have not been able to find out how an application could use this data type. I believe that the type id is for user-defined types, which are not supported by Derby (at least not exposed to the applications). If my assumptions are correct, the full list of types that should throw SQLFeatureNotSupportedException is: ARRAY, DATALINK, JAVA_OBJECT, NCHAR, NCLOB, NVARCHAR, LONGNVARCHAR, REF, ROWID, SQLXML and STRUCT.

> 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

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