This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

NullPointerException with stmt.executeUpdate  RSS feed

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!