It's not a secret anymore!*
The moose likes JDBC and the fly likes NullPointerException with stmt.executeUpdate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "NullPointerException with stmt.executeUpdate" Watch "NullPointerException with stmt.executeUpdate" New topic
Author

NullPointerException with stmt.executeUpdate

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hello,
Wondering why I get a NullPointerException when executing:
stmt.executeUpdate("INSERT INTO PEOPLE (PRI,LOGIN_TYPE) VALUES ('2123','234')");
The complete code is:


[This message has been edited by Yoo-Jin, Lee (edited July 07, 2000).]
Milind Kulkarni
Ranch Hand

Joined: Jun 01, 2000
Posts: 146
Hi Lee,
Insert the following line -
Statement stmt = con.createStatement ();
before
stmt.executeUpdate("INSERT INTO PEOPLE (PRI,LOGIN_TYPE) VALUES ('2123','234')");

Also change the above line as follows:
int i = stmt.executeUpdate("INSERT INTO PEOPLE (PRI,LOGIN_TYPE) VALUES ('2123','234')");

Hope this helps !!
Regards,
Milind

[This message has been edited by Milind Kulkarni (edited July 07, 2000).]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NullPointerException with stmt.executeUpdate
 
Similar Threads
No Suitible Driver Error
Access to the Oracle database using Java Applets
ClassNotFoundException generated!
Only one chinese charcter '塚' cant able to insert by JDBC
how to run code in netbeans