Writing portable SQL code in Java

From: Laurent Duperval <lduperval(at)microcelli5(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Writing portable SQL code in Java
Date: 2001-05-16 13:59:01
Message-ID: 20010516135931.038574696C@lenard.microcelli5.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)microcelli5(dot)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

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2001-05-16 14:58:42 Re: Writing portable SQL code in Java
Previous Message Philip Crotwell 2001-05-16 13:11:30 RE: finalize in LargeObject