[jira] Commented: (DERBY-1393) PreparedStatement.setObject(Object,int,int) should throw for unsupported types
[ 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
[ 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
[ 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
Re: [jira] Commented: (DERBY-1393) PreparedStatement.setObject(Object,int,int) should throw for unsupported types
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
[ 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
[ 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
[jira] Commented: (DERBY-1393) PreparedStatement.setObject(Object,int,int) should throw for unsupported types
[ 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
[jira] Commented: (DERBY-1393) PreparedStatement.setObject(Object,int,int) should throw for unsupported types
[ 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