Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 1864 invoked from network); 29 Jun 2006 12:41:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 29 Jun 2006 12:41:12 -0000 Received: (qmail 88956 invoked by uid 500); 29 Jun 2006 12:41:11 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 88924 invoked by uid 500); 29 Jun 2006 12:41:11 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 88909 invoked by uid 99); 29 Jun 2006 12:41:11 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Jun 2006 05:41:11 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Jun 2006 05:41:10 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 5D857410123 for ; Thu, 29 Jun 2006 12:39:33 +0000 (GMT) Message-ID: <16428253.1151584773380.JavaMail.jira@brutus> Date: Thu, 29 Jun 2006 12:39:33 +0000 (GMT+00:00) From: "Knut Anders Hatlen (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-1393) PreparedStatement.setObject(Object,int,int) should throw for unsupported types In-Reply-To: <10822355.1149946709861.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ 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