Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
The moose likes JDBC and Relational Databases and the fly likes Parameter index of 1 is out of range (1, 0) while registering out parameter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Parameter index of 1 is out of range (1, 0) while registering out parameter" Watch "Parameter index of 1 is out of range (1, 0) while registering out parameter" New topic
Author

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

vipul javeri
Greenhorn

Joined: Jul 04, 2011
Posts: 10
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.
Pramod Kankure
Greenhorn

Joined: Oct 25, 2011
Posts: 6
I think you have to use { in your stored procedure call. So try con.prepareCall("{ call storeprocedurename(?, ?) }");
vipul javeri
Greenhorn

Joined: Jul 04, 2011
Posts: 10
I tried with that also.. but it dint solve the issue
vipul javeri
Greenhorn

Joined: Jul 04, 2011
Posts: 10
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

Joined: Jul 04, 2011
Posts: 10
one more thing.. the out parameter should be before the IN parameters... is this a bug for calling mysql procedure through Java??
 
Have you tried LearnNowOnline? http://www.learnnowonline.com/
 
subject: Parameter index of 1 is out of range (1, 0) while registering out parameter