Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 39222 invoked from network); 12 May 2006 12:52:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 May 2006 12:52:33 -0000 Received: (qmail 49146 invoked by uid 500); 12 May 2006 12:52:33 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 48923 invoked by uid 500); 12 May 2006 12:52:32 -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 48914 invoked by uid 99); 12 May 2006 12:52:32 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 May 2006 05:52:32 -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; Fri, 12 May 2006 05:52:30 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 8AD24714292 for ; Fri, 12 May 2006 12:52:09 +0000 (GMT) Message-ID: <2462400.1147438329566.JavaMail.root@brutus> Date: Fri, 12 May 2006 12:52:09 +0000 (GMT+00:00) From: =?utf-8?Q?=C3=98ystein_Gr=C3=B8vlen_=28JIRA=29?= To: derby-dev@db.apache.org Subject: [jira] Closed: (DERBY-1321) ClassCastException in client for batched statements In-Reply-To: <30712723.1147423290917.JavaMail.root@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-1321?page=3Dall ] =20 =C3=98ystein Gr=C3=B8vlen closed DERBY-1321: ---------------------------------- Resolution: Duplicate This is a duplicate of Derby-1292. Thanks to Gerald Khin who made me aware= of that. > ClassCastException in client for batched statements > --------------------------------------------------- > > Key: DERBY-1321 > URL: http://issues.apache.org/jira/browse/DERBY-1321 > Project: Derby > Type: Bug > Components: Network Client > Versions: 10.2.0.0 > Environment: Solaris x86, trunk of March 31st > Reporter: =C3=98ystein Gr=C3=B8vlen > Attachments: RunDerby.java > > In a program using the client driver, I get a ClassCastException when bat= ching prepared statements. The code that creates the problem is: > stmt =3D connection.createStatement(); =09 > stmt.executeUpdate("CREATE TABLE LONGTESTTABLE ( LONG_VALUE N= UMERIC(20) )"); > String sql =3D "insert into LONGTESTTABLE (LONG_VALUE) values= ( ? )"; > PreparedStatement pstmt =3D connection.prepareStatement(sql); > pstmt.setLong(1, (long)10 ); // long value > pstmt.addBatch(); > //pstmt.setNull(1, Types.BIGINT ); // THIS WORKS > pstmt.setNull(1, Types.INTEGER ); // THIS DOES NOT WORK > pstmt.addBatch(); > int[] updateCounts =3D pstmt.executeBatch(); > If I add the second statement to the batch before the first one, it works= . > If I insert an executeBatch() between the statements, it works > If I execute this with the embedded driver, it works > The stack trace I get is: > Exception in thread "main" java.lang.ClassCastException: java.lang.Long > at org.apache.derby.client.net.NetStatementRequest.buildFDODTA(Net= StatementRequest.java:692) > at org.apache.derby.client.net.NetStatementRequest.buildSQLDTAcommand= Data(NetStatementRequest.java:530) > at org.apache.derby.client.net.NetStatementRequest.writeExecute(NetState= mentRequest.java:137) > at org.apache.derby.client.net.NetPreparedStatement.writeExecute_(NetP= reparedStatement.java:118) > at org.apache.derby.client.am.PreparedStatement.writeExecute(Prep= aredStatement.java:1336) > at org.apache.derby.client.am.PreparedStatement.executeBatchReques= tX(PreparedStatement.java:1807) > at org.apache.derby.client.am.PreparedStatement.executeBatchX(Prep= aredStatement.java:1731) > at org.apache.derby.client.am.PreparedStatement.executeBatch(Prepar= edStatement.java:1184) > at RunDerby.main(RunDerby.java:81) --=20 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