incubator-empire-db-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eike Kettner <>
Subject Re: Work on EMPIREDB-103 (DDL duplicate code) almost complete!
Date Mon, 10 Oct 2011 21:19:49 GMT

I just ran the basic and advances examples on my linux machine with
postgresql 8.4.8, mysql 5.1.49 and derby

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(
	at org.apache.empire.db.DBRecordData.getString(
	at org.apache.empire.db.DBRecordData.getString(
	at org.apache.empire.samples.db.SampleApp.queryRecords(
	at org.apache.empire.samples.db.SampleApp.main(

The problem is line 422 of, it says


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 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?


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:  pgp: 481161A0

View raw message