aspose file tools*
The moose likes JDBC 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
JavaRanch » Java Forums » Databases » JDBC
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??
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Parameter index of 1 is out of range (1, 0) while registering out parameter