java.lang.ClassNotFoundException: com.ibm.db2.jdbc.app.DB2Driver
843859Dec 28 2007 — edited Nov 20 2014hi i wrriten the following java code for database connection.
/*
* Created on Dec 27, 2007
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
/**
* @author Admin
*
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
import java.sql.*;
public class DB2 {
public static void main(String[] args) {
Connection cn;
ResultSet rs;
Statement st;
try
{
Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
}
catch(ClassNotFoundException se)
{
se.printStackTrace();
System.out.println(se);
}
try
{
cn=DriverManager.getConnection("jdbc:db2:sample","db2admin","admin");
st=cn.createStatement();
st.executeUpdate("create table new(name char(10),age int)");
}
catch(SQLException se)
{
se.printStackTrace();
}
}
}
But i got error like
java.lang.ClassNotFoundException: com.ibm.db2.jdbc.app.DB2Driver
Pls rectify this error........