Return-Path: X-Original-To: apmail-incubator-empire-db-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-empire-db-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C76B4728E for ; Mon, 10 Oct 2011 21:20:13 +0000 (UTC) Received: (qmail 24210 invoked by uid 500); 10 Oct 2011 21:20:13 -0000 Delivered-To: apmail-incubator-empire-db-dev-archive@incubator.apache.org Received: (qmail 24166 invoked by uid 500); 10 Oct 2011 21:20:13 -0000 Mailing-List: contact empire-db-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: empire-db-dev@incubator.apache.org Delivered-To: mailing list empire-db-dev@incubator.apache.org Received: (qmail 24158 invoked by uid 99); 10 Oct 2011 21:20:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Oct 2011 21:20:13 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [87.118.96.127] (HELO mail.eknet.org) (87.118.96.127) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Oct 2011 21:20:06 +0000 Received: from ithaka (84-73-219-248.dclient.hispeed.ch [84.73.219.248]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.eknet.org (Postfix) with ESMTPSA id 8D5C69D4091 for ; Mon, 10 Oct 2011 23:19:45 +0200 (CEST) Date: Mon, 10 Oct 2011 23:19:49 +0200 From: Eike Kettner To: empire-db-dev@incubator.apache.org Subject: Re: Work on EMPIREDB-103 (DDL duplicate code) almost complete! Message-ID: <20111010211948.GB6433@ithaka> References: <20111009153616.767B023889E3@eris.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Operating-System: Debian GNU/Linux 6.0.2 (Kernel 2.6.37-mybigmem) User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Checked: Checked by ClamAV on apache.org Hi! I just ran the basic and advances examples on my linux machine with postgresql 8.4.8, mysql 5.1.49 and derby 10.4.2.0. All went well except for the basic example with postgresql. Here is the stack trace: org.apache.empire.exceptions.InvalidArgumentException: Invalid Argument -1 for parameter index. at org.apache.empire.db.DBReader.getValue(DBReader.java:370) at org.apache.empire.db.DBRecordData.getString(DBRecordData.java:193) at org.apache.empire.db.DBRecordData.getString(DBRecordData.java:206) at org.apache.empire.samples.db.SampleApp.queryRecords(SampleApp.java:419) at org.apache.empire.samples.db.SampleApp.main(SampleApp.java:135) The problem is line 422 of SampleApp.java, it says reader.getString(PHONE_EXT_NUMBER) It seems that the query depends on the dbms. In line 380-386, the "column" PHONE_EXT_NUMBER is only added to the query if it's _not_ postgresql. The comment states, that this is due to posgresql not supporting substring. I'm pretty sure, that postgre supports this (see http://www.postgresql.org/docs/8.1/static/functions-string.html) So I bravely removed the if condition and the example ran successfully. Are there any other reasons for this if-condition? I'd then say, we should remove it, since substring is supported by postgre? Regards, Eike On [Mon, 10.10.2011 00:28], Rainer D�bele wrote: > Hi folks, > > I am happy to announce that I have almost completed another major task that has long been overdue: The reduction of duplicate code for DDL generation. > > Doesn't sound like much, but this issue has been quite a bit of work and hence took me quite a bit of time. > I have tried my best to achieve the same results as before by comparison of the DDL outcome. > But I have not been able to make real database tests against the following databases: MySQL, Postgre, H2, Derby. > However I have tested Oracle, SQLServer and HSQLDB. > > Is anyone able to test it with any of the remaining databases by running at least the basic and the advanced sample? > > Cheers, > Rainer > -- email: eike@eknet.org https://www.eknet.org pgp: 481161A0