• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NullPointerException thrown when calling registerOutParameter (CallableStatement)

 
Samuel Cadieux
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks,

I'm currently developing a website for a student news paper. Everything was going alright excepting one detail that I encountered yesterday.

When I am calling the following line, a NullPointerException is thrown:


I am using MySQL 5.0.51a-community-nt and connector 5.1.6.

Here is the details:






As an additional information, here comes the MySQL log:



Oh by the way, I've posted a similar message on http://forums.mysql.com/read.php?39,209209,209209, but unfortunately no answer has been yet posted.

[ May 12, 2008: Message edited by: Samuel Cadieux ]
[ May 12, 2008: Message edited by: Samuel Cadieux ]
 
Herman Schelti
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

I looked at http://www.exampledepot.com/egs/java.sql/CallProcedure.html
try to add the word "call".



Herman
[ May 13, 2008: Message edited by: Herman Scheltinga ]
 
Campbell Ritchie
Sheriff
Posts: 51368
87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please use copy-and-past for quoting code, otherwise people get confused about characters like ` when I am sure you mean '.

Can't see anything wrong with your SQL on a brief look, but I don't think that is relevant to the NullPointerException (NPE). If you have correctly quoted the line throwing the NPE the problem is that statement is null.

NPEs come up all the time; look at this post, and this post where somebody struggled to work out an NPE. Note older links in that latter thread.

Find out whether statement is null, if not, then something else is null.

Tell us whether that lot helps, and welcome to JavaRanch.
 
Samuel Cadieux
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Herman Scheltinga:
hi,

I looked at http://www.exampledepot.com/egs/java.sql/CallProcedure.html
try to add the word "call".



Herman

[ May 13, 2008: Message edited by: Herman Scheltinga ]


That's it! I forgot to write CALL before my procedure name.

That makes me fell stupid

Thanks alot Herman!
 
Campbell Ritchie
Sheriff
Posts: 51368
87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No need to feel stupid; we all make that sort of mistake. And your English is all right too.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic