Hi JDBC gurus, I am facing a very wierd problem - any help appreciated. Here is the simple code: try { Class.forName("oracle.jdbc.driver.OracleDriver"); Connection c = DriverManager.getConnection(connURL, dbUserName, dbPassword); System.out.println("Connected correctly: "); } catch(ClassNotFoundException cnfe) { System.out.println("Error loading driver: " + cnfe); } The above works fine but when I add this line: Statement stmt = c.createStatement(); it fails, giving the following error: java.lang.NullPointerException at myClasses.DbBean.isLoginValid(DbBean.java:107) pointing to line which has the Statemnt stmt =... Any ideas why? I am going crazy here Thanks!
raghavender rao
Ranch Hand
Joined: Jul 20, 2001
Posts: 45
posted
0
hi ther, i think Connection object is null... try System.out.println(con);
Rao<BR>Sun Certified Programmer for the Java��� 2 Platform