Return-Path: Delivered-To: apmail-db-ojb-dev-archive@www.apache.org Received: (qmail 70433 invoked from network); 18 Dec 2005 11:44:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 18 Dec 2005 11:44:26 -0000 Received: (qmail 98889 invoked by uid 500); 18 Dec 2005 11:44:26 -0000 Delivered-To: apmail-db-ojb-dev-archive@db.apache.org Received: (qmail 98806 invoked by uid 500); 18 Dec 2005 11:44:25 -0000 Mailing-List: contact ojb-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "OJB Developers List" Reply-To: "OJB Developers List" Delivered-To: mailing list ojb-dev@db.apache.org Received: (qmail 98795 invoked by uid 500); 18 Dec 2005 11:44:25 -0000 Received: (qmail 98792 invoked by uid 99); 18 Dec 2005 11:44:25 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 Dec 2005 03:44:24 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 18 Dec 2005 03:44:24 -0800 Received: (qmail 70308 invoked by uid 1797); 18 Dec 2005 11:44:03 -0000 Date: 18 Dec 2005 11:44:03 -0000 Message-ID: <20051218114403.70307.qmail@minotaur.apache.org> From: tomdz@apache.org To: db-ojb-cvs@apache.org Subject: cvs commit: db-ojb/src/java/org/apache/ojb/broker/platforms PlatformDerbyImpl.java X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N tomdz 2005/12/18 03:44:03 Modified: src/java/org/apache/ojb/broker/platforms Tag: OJB_1_0_RELEASE PlatformDerbyImpl.java Log: Added workaround for handling of Character instances in Derby Revision Changes Path No revision No revision 1.1.2.3 +32 -0 db-ojb/src/java/org/apache/ojb/broker/platforms/Attic/PlatformDerbyImpl.java Index: PlatformDerbyImpl.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/platforms/Attic/PlatformDerbyImpl.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- PlatformDerbyImpl.java 13 Dec 2005 20:29:20 -0000 1.1.2.2 +++ PlatformDerbyImpl.java 18 Dec 2005 11:44:03 -0000 1.1.2.3 @@ -1,5 +1,9 @@ package org.apache.ojb.broker.platforms; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.sql.Types; + /* Copyright 2002-2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -32,6 +36,34 @@ /** * {@inheritDoc} */ + protected String getConcatenationCharacter() + { + return ","; + } + + /** + * {@inheritDoc} + */ + public void setObjectForStatement(PreparedStatement ps, int index, Object value, int jdbcType) throws SQLException + { + if (((jdbcType == Types.CHAR) || (jdbcType == Types.VARCHAR)) && + (value instanceof Character)) + { + // [tomdz] + // Currently, Derby doesn't like Character objects in the PreparedStatement + // when using PreparedStatement#setObject(index, value, jdbcType) method + // So we make a String object out of the Character object and use that instead + super.setObjectForStatement(ps, index, value.toString(), jdbcType); + } + else + { + super.setObjectForStatement(ps, index, value, jdbcType); + } + } + + /** + * {@inheritDoc} + */ public String getLastInsertIdentityQuery(String tableName) { // matthias.roth@impart.ch --------------------------------------------------------------------- To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org For additional commands, e-mail: ojb-dev-help@db.apache.org