aspose file tools*
The moose likes JDBC and the fly likes is db2 by default 'servicing' jdbc 1? or 2? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "is db2 by default Watch "is db2 by default New topic
Author

is db2 by default 'servicing' jdbc 1? or 2?

Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2057
is db2, by default, recognizes jdbc 1? if yes, how do i make it recognize jdbc 2?
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

Jesus,

There is no "Default" when it comes to database drivers. It uses whichever driver you have told it to use ( The whole Class.forName or DriverManager.registerDriver() part in your code ). So, if you want to be sure, download the latest jdbc drivers available for your version of DB2, then you'll know that you are not using a legacy/out-dated driver.

**NOTE**- If your java code is running on the AS/400 ( native OS for DB2 ), there are property settings telling the AS/400 what jdk it is supposed to use. That is the only restriction that I can see related to your question.

If you are having a specific problem, post the exception and a code snippet along with an explanation of the program behaviour.

Jamie

Jamie
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30916
    
158

Jesus,
You need to run the batch file called java12.bat or usejava12.bat (I forget which.) Make sure to shut down the db2 services first.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2057
thanks for your replies.

jeanne, that is what i wanted to do as instructed, in an old book i am reading - that book referring to an older version of db2.

but with this 8.1 version, i cant find any .bat file in the entire installed folder, that is named like that.

that is why i am not sure
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30916
    
158

Jesus,
In db2 7 (which I use), it is in DB2_INSTALL_DIR/sqllib/java12/usejdbc2.bat. According to google, it is in DB2_INSTALL_DIR/java12/usejdbc2 in db2 8.
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2057
jeanne, for 8.1 there is no directory like taht on my folder...what keyword did u use at google to look for it?....thanks
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2057
jeanne, i found the answer, i think, ill post it tomorrow, as im rushing.....answer is , for 8.1 and higher, no need to do usejdbcxx
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30916
    
158

Jesus,
Good to know. Thanks for posting the answer.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: is db2 by default 'servicing' jdbc 1? or 2?