Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 66881 invoked from network); 23 Aug 2005 15:27:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 23 Aug 2005 15:27:15 -0000 Received: (qmail 27581 invoked by uid 500); 23 Aug 2005 15:27:14 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 27337 invoked by uid 500); 23 Aug 2005 15:27:12 -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: "Derby Development" Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 27324 invoked by uid 99); 23 Aug 2005 15:27:12 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=SPF_FAIL X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Aug 2005 08:27:11 -0700 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 54816121 for ; Tue, 23 Aug 2005 17:27:09 +0200 (CEST) Message-ID: <484474349.1124810829922.JavaMail.jira@ajax.apache.org> Date: Tue, 23 Aug 2005 17:27:09 +0200 (CEST) From: "Piet Blok (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Created: (DERBY-530) ClientDriver ignores Properties object in connect(String url, Properties connectionProperties) method 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 ClientDriver ignores Properties object in connect(String url, Properties connectionProperties) method ----------------------------------------------------------------------------------------------------- Key: DERBY-530 URL: http://issues.apache.org/jira/browse/DERBY-530 Project: Derby Type: Bug Components: Network Client Versions: 10.1.1.0 Environment: windows XP, JRE 1.5.0_04 Reporter: Piet Blok In contrast to EmbeddedDriver, a connection attribute create=true is not recognized when presented as a property in a Properties object. As a workaround I append the attributes from the Properties object to the url string before invoking the connect() method: then a new database is created and a connection is established. Next code fragment illustrates the bug and the workaround: private static final ClientDriver clientDriver = new ClientDriver(); private Connection getClientConnection(String database, Properties connectionProperties) throws SQLException { try { System.out.println("Try to connect with properties"); String connectionURL = "jdbc:derby://127.0.0.1:1527/" + database; System.out.println("connectionURL: " + connectionURL); Connection rv = clientDriver.connect(connectionURL, connectionProperties); System.out.println("Connection: " + rv); return rv; } catch (SQLException e) { System.out.println("Try to connect with URL attributes"); StringBuffer sb = new StringBuffer(); for (Enumeration enu = connectionProperties.propertyNames(); enu .hasMoreElements();) { String key = (String) enu.nextElement(); sb.append(';'); sb.append(key); sb.append('='); sb.append(connectionProperties.getProperty(key, "")); } String connectionURL = "jdbc:derby://127.0.0.1:1527/" + database + sb.toString(); System.out.println("connectionURL: " + connectionURL); Connection rv = clientDriver.connect(connectionURL, connectionProperties); System.out.println("Connection: " + rv); System.out .println("!!!!!!!!!!! seems a bug: Properties argument in ClientDriver.connect(String, Properties) has not been used"); return rv; } } -- 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