------------------CODE Snippets For Connecting to DB2 Database-----------------------
Connecting to DB2 :
driverclassname = "COM.ibm.db2.jdbc.app.DB2Driver";
dbprefix += "db2:";
For DB2 Pure NetWork client:
driverclassname = "COM.ibm.db2.jdbc.net.DB2Driver";
dbprefix += "db2:";
System.out.println("Loading jdbc driver: " + driverclassname);
Class.forName(driverclassname);
DBURL = jdbc:db2:dbname;
DBURL = dbprefix + DBURL;
After that get the useid and password from user :
con = DriverManager.getConnection(DBURL, userid, password);
---------------------------------Connection Successful-------------------------------
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment