Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Noob : DB2 connection with jdbc

 
sarvananda sarvananda
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I consulted the FAQ on this forum, searched this and suns forum and google as well.. still I am clueless with this.
Dear all,

I am failry versed with java and jdbc. I did a lot of google and searched a lot of forums but no one gave me all the details. I have done a lot of oracle jdbc. I would appreciate if some one could give me all the details please. I dont even know which jar files should be in the classpath.

Oracle Comparision :
place ojdb14.jar in classpath

Class.forName("oracle.jdbc.driver.OracleDriver");
// Create a connection to the database
String serverName = "127.0.0.1";
String portNumber = "1521";
String sid = "oracle";
String url = "jdbcracle:thin:@" + serverName + ":" + portNumber + ":" + sid;
String username = "scott";
String password = "tiger";
connection = DriverManager.getConnection(url, username, password);
// Create a result set containing all data from my_table
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM sometable");




I am just about clueless on db2 .. (was able to scape through the install and the install is fine.)....just know that db2java.zip should be on the classpath....thats all..

TIA
 
sarvananda sarvananda
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
right.. i went very far with this.
I have a trial version installed on my machine. The prog. kept saying wrong user id an pwd. Finally, it revoked the administrators account... and now even after pouring through googles search I still dont know how to "un-revoke" my admin account. I am able to connect to db2 on another machine though. So now essesntially the question lingers on, 1)how can I reactivate my admin account(the one it asks while installing the db).?2) After learning this, I created an account on the other machine using the control center, however there is no place where I can give a password. Any ideas with this ?

i know this is very very basic, but I am stuck at this.

TIA for all your help
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34965
377
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On my Window's machine, the db2 admin password is an operating system level account. It locks out when I type the password in wrong a certain number of times. To unlock it, I have to go into the windows control panel and unlock the account.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic