Please Help - Java, Database oracle or sybase  
Author Message
jill





PostPosted: 2006-2-9 23:23:00 Top

java-programmer, Please Help - Java, Database oracle or sybase Hi All,

I am a java programmer used to using oracle database.

In my new job, we have oracle plus sybase database. Some applications
use oracle and some use Sybase. I am writing framework, so it can be
used by all applications.

Is it possible to write connection code, independent of database
driver, by just using java.sql package.
One problem I am seeing in sql package is java.sql.types does not have
cursor. I don't know how sybase returns a resultset but java.sql.other
does not look very promising.

Could any body suggest a general solution using two different database.

Thanks a lot,
Jill.

 
Joe Weinstein





PostPosted: 2006-2-10 0:16:00 Top

java-programmer >> Please Help - Java, Database oracle or sybase

jill wrote:

> Hi All,
>
> I am a java programmer used to using oracle database.
>
> In my new job, we have oracle plus sybase database. Some applications
> use oracle and some use Sybase. I am writing framework, so it can be
> used by all applications.
>
> Is it possible to write connection code, independent of database
> driver, by just using java.sql package.
> One problem I am seeing in sql package is java.sql.types does not have
> cursor. I don't know how sybase returns a resultset but java.sql.other
> does not look very promising.
>
> Could any body suggest a general solution using two different database.
>
> Thanks a lot,
> Jill.

Hi. Unfortunately the world is not simple enough for that.
For a given application you can confine the DBMS-related code
to a given area, but different DBMSes offer significant amounts
of their functionality in a vendor-specific way, so in order to
effectively use a DBMS, you have to have significant vendor-specific
code. As you have seen, a cursor return from a stored procedure
output parameter is a non-standard Oracle thing. Sybase and Oracle
stored procedures are important, and different. Furthermore,
Sybase and Oracle locking behavior are different, so a transaction
may behave significantly differently in one DBMS than another.
I understand the impulse to want to treat DBMSes as interchangeable
black-box file data stores, but it is a doomed approach as soon
as performance or transactions are required. If a non-trivial
application works *well* with one DBMS, it is because it benefits
from DBMS-specific functionality, and trying to switch it to use
another type of DBMS may take *architectural* changes, not just
DBMS-access switching.
Good luck,
Joe Weinstein at BEA Systems

 
jill





PostPosted: 2006-2-10 2:21:00 Top

java-programmer >> Please Help - Java, Database oracle or sybase Thanks a lot Joe for your input.

 
 
Roedy Green





PostPosted: 2006-2-10 6:26:00 Top

java-programmer >> Please Help - Java, Database oracle or sybase On 9 Feb 2006 07:22:38 -0800, "jill" <email***@***.com> wrote,
quoted or indirectly quoted someone who said :

>Could any body suggest a general solution using two different database.
see http://mindprod.com/jgloss/or.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.