Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Jesus Angeles
Ranch Hand
Posts: 2068
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is db2, by default, recognizes jdbc 1? if yes, how do i make it recognize jdbc 2?
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jesus Angeles
Ranch Hand
Posts: 2068
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2068
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2068
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jesus,
Good to know. Thanks for posting the answer.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic