• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Parameter index of 1 is out of range (1, 0) while registering out parameter

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am getting the error Parameter index of 1 is out of range (1, 0) when i try to register out parameter for the procedure.
Please tell me what is wrong with my code


The procedure in MYSQL is ::



Please help
Thanks in advance.
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you have to use { in your stored procedure call. So try con.prepareCall("{ call storeprocedurename(?, ?) }");
 
vipul javeri
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried with that also.. but it dint solve the issue
 
vipul javeri
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This issue is solved. The problem was of jar file , earlier i was using mysql-connector-java-5.1.18-bin.jar and when i changed the jar to mysql-connector-java-5.1.18-bin.jar it worked..Thanks
 
vipul javeri
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
one more thing.. the out parameter should be before the IN parameters... is this a bug for calling mysql procedure through Java??
 
reply
    Bookmark Topic Watch Topic
  • New Topic