Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 33512 invoked from network); 6 Nov 2010 01:44:31 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 6 Nov 2010 01:44:31 -0000 Received: (qmail 97597 invoked by uid 500); 6 Nov 2010 01:45:02 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 97568 invoked by uid 500); 6 Nov 2010 01:45:02 -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 97561 invoked by uid 99); 6 Nov 2010 01:45:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 Nov 2010 01:45:02 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 Nov 2010 01:45:02 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id oA61ifv7015200 for ; Sat, 6 Nov 2010 01:44:41 GMT Message-ID: <30875431.49011289007881957.JavaMail.jira@thor> Date: Fri, 5 Nov 2010 21:44:41 -0400 (EDT) From: "Knut Anders Hatlen (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Created: (DERBY-4890) Different string to boolean conversion on embedded and client MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Different string to boolean conversion on embedded and client ------------------------------------------------------------- Key: DERBY-4890 URL: https://issues.apache.org/jira/browse/DERBY-4890 Project: Derby Issue Type: Bug Components: JDBC Affects Versions: 10.7.1.0 Reporter: Knut Anders Hatlen The following code fragment behaves differently on client and embedded: PreparedStatement ps = c.prepareStatement("values cast(? as boolean)"); ps.setString(1, "TRUE"); ResultSet rs = ps.executeQuery(); rs.next(); System.out.println(rs.getBoolean(1)); Embedded prints "true". Client raises an exception: Exception in thread "main" java.sql.SQLDataException: An attempt was made to get a data value of type 'VARCHAR' from a data value of type 'BOOLEAN'. at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:72) at org.apache.derby.client.am.SqlException.getSQLException(SqlException.java:358) at org.apache.derby.client.am.PreparedStatement.setString(PreparedStatement.java:884) at SetByte.main(SetByte.java:6) Caused by: org.apache.derby.client.am.SqlException: An attempt was made to get a data value of type 'VARCHAR' from a data value of type 'BOOLEAN'. at org.apache.derby.client.am.PreparedStatement$PossibleTypes.throw22005Exception(PreparedStatement.java:3069) at org.apache.derby.client.am.PreparedStatement.setString(PreparedStatement.java:874) ... 1 more -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.