Click to See Complete Forum and Search --> : Question on createStatement()


hcarousel
06-22-2006, 02:25 PM
I tried to use the following statement in Java to create a Statement object,

Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);

but I got java.lang.NullPointerException error. Can anybody tell me what's wrong with my code?

By the way, I am using mysql on a unix system.

Thanks!

NogDog
06-23-2006, 01:57 PM
Since it's a Java exception, I'm going to move this to the Java forum....

Khalid Ali
06-23-2006, 03:12 PM
chances are that con is null, however you must provide witht he full text of exception and the code snippet( abit more then one line that u have up there)