I am getting the following error when I try to get the connection from a Db2 DB. I am running the program from WSAD 5.1.2 IDE. All the class path and the required JAR files are properly set in my IDE.
Error: java.lang.NoClassDefFoundError: java/lang/CharSequence at com.ibm.db2.jcc.c.p.<init>(p.java:52) at com.ibm.db2.jcc.b.b.<init>(b.java:256) at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:163) at java.sql.DriverManager.getConnection(DriverManager.java:543) at java.sql.DriverManager.getConnection(DriverManager.java:194) at org.javacamp.factory.TestConnection.getDirectConnection(TestConnection.java:108) at org.javacamp.factory.TestConnection.main(TestConnection.java:118) Exception in thread "main"
Sriram, Interface "CharSequence" was introduced with java 1.4, according to its javadoc. According to the stack trace you posted, it appears that the JDBC driver you are using does not recognize it. Logical inference is perhaps your JDBC driver is not compatible with java 1.4, or higher?