Unix Technical Forum

db2 java application of 32-bit and 64-bit DB2 insatnce

This is a discussion on db2 java application of 32-bit and 64-bit DB2 insatnce within the DB2 forums, part of the Database Server Software category; --> I did a test on running db2 database java code on 32-bit and 64-bit db2 instance. It seams that ...


Go Back   Unix Technical Forum > Database Server Software > DB2

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-20-2008, 01:46 PM
zgh1970
 
Posts: n/a
Default db2 java application of 32-bit and 64-bit DB2 insatnce

I did a test on running db2 database java code on 32-bit and 64-bit
db2 instance.
It seams that java application with 32-bit JVM couldn't run at 64-bit
db2 instance.
Also 64-bit JVM couldn't run at 32-bit db2 instance.
I will show the following error:
A database problem has occurred - java.sql.SQLException: No suitable
driver

IBM only provides SQC on different 32-bit and 64-bit.
DB2 instance will have different LIB for 32 and 64 bit instance.
But for JAVA, I didn't find JAVA driver with 32-bit and 64-bit.
How DB2 get the driver for 32-bit and 64-bit instance?
When I upgrade db2 instance 32-bit to 64-bit, What will I need to do
for the exsting JAVA database application?
I just need to use 64-bit JVM recompile it and run it wiht 64-bit JVM?

thanks,
George
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-20-2008, 01:46 PM
Darin McBride
 
Posts: n/a
Default Re: db2 java application of 32-bit and 64-bit DB2 insatnce

zgh1970 wrote:

> I did a test on running db2 database java code on 32-bit and 64-bit
> db2 instance.
> It seams that java application with 32-bit JVM couldn't run at 64-bit
> db2 instance.


Correct, if you're using the Type2 driver.

> Also 64-bit JVM couldn't run at 32-bit db2 instance.
> I will show the following error:
> A database problem has occurred - java.sql.SQLException: No suitable
> driver
>
> IBM only provides SQC on different 32-bit and 64-bit.
> DB2 instance will have different LIB for 32 and 64 bit instance.
> But for JAVA, I didn't find JAVA driver with 32-bit and 64-bit.


The type 2 driver will load libdb2 from the sqllib/lib directory, and that's
causing your problem.

> How DB2 get the driver for 32-bit and 64-bit instance?
> When I upgrade db2 instance 32-bit to 64-bit, What will I need to do
> for the exsting JAVA database application?


Use a 64-bit JVM ;-)

> I just need to use 64-bit JVM recompile it and run it wiht 64-bit JVM?


You shouldn't need to recompile anything, unless you have your own JNI code.
Or you can use a type 4 driver which would provide further independence
from the DB2 native code.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-20-2008, 01:46 PM
zgh1970
 
Posts: n/a
Default Re: db2 java application of 32-bit and 64-bit DB2 insatnce

On Mar 18, 11:27*am, Darin McBride
<dmcbr...@naboo.to.org.no.spam.for.me> wrote:
> zgh1970 wrote:
> > I did a test on running db2 database java code on 32-bit and 64-bit
> > db2 instance.
> > It seams that java application with 32-bit JVM couldn't run at 64-bit
> > db2 instance.

>
> Correct, if you're using the Type2 driver.
>
> > Also 64-bit JVM couldn't run at 32-bit db2 instance.
> > I will show the following error:
> > A database problem has occurred - java.sql.SQLException: No suitable
> > driver

>
> > *IBM only provides SQC on different 32-bit and 64-bit.
> > DB2 instance will have different LIB for 32 and 64 bit instance.
> > But for JAVA, I didn't find JAVA driver with 32-bit and 64-bit.

>
> The type 2 driver will load libdb2 from the sqllib/lib directory, and that's
> causing your problem.
>
> > How DB2 get the driver for 32-bit and 64-bit instance?
> > When I upgrade db2 instance 32-bit to 64-bit, What *will I need to do
> > for the exsting JAVA database application?

>
> Use a 64-bit JVM ;-)
>
> > I just need to use 64-bit JVM recompile it and run it wiht 64-bit JVM?

>
> You shouldn't need to recompile anything, unless you have your own JNI code.
> Or you can use a type 4 driver which would provide further independence
> from the DB2 native code.


Hi, Darin,
You are right.
That code is using JDBC type-2.
I tried useing the type 4, I can use 32-bit or 64-bit JVM to run the
class file without recompiling.

thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:19 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com