Writing portable SQL code in Java - Mailing list pgsql-jdbc

From Laurent Duperval
Subject Writing portable SQL code in Java
Date
Msg-id 20010516135931.038574696C@lenard.microcelli5.com
Whole thread Raw
List pgsql-jdbc
Hi,

Are there any guidelines for writing portable Java code using different SQL
DBMS engines? Specifically, I'm writing code that will be ultimately
deployed on Oracle. I don't really care for encumbering my disk with 300 MB
of Oracle stuff, just to have access to a bad ui (sqlplus) and a few
libraries. So I've started to do the code using Postgres but now, I'm at a
situation where I'm looking at being forced to install oracle. Here are some
of the issues I'm finding:

- setBytes() doesn't work as I expect. I have to use Oracle's RAW type and I
  haven't been able to use setBytes correctly on Postgres. I'm not sure why,
  yet. I get cast exceptions, for one but I don't know why that would
  happen.

- sequences don't work the same. In my Java code, I have to get sequence
  numbers. It's fairly easy in Postgres (select nextval ('seq')) but the
  syntax in Oracle is different (select seq.nextval from DUAL).

I have to write Oracle-centric code in my Java stuff and I'm trying to see
if it's worth it to do some extra work to make it work or not. Anyone have
any comments on this?

L

--
Laurent Duperval <mailto:lduperval@microcelli5.com>

D'obscures manoeuvres ont eu lieu dans l'ombre et je ferai toute la lumière
sur ces ténébreux agissements! C'est du marché noir!
                                             -Achille Talon


pgsql-jdbc by date:

Previous
From: Philip Crotwell
Date:
Subject: RE: finalize in LargeObject
Next
From: "Dave Cramer"
Date:
Subject: Re: Writing portable SQL code in Java