| Author |
SQLException:Parameter Index out of Range
|
Swapna Gouri Kalanidhi
Ranch Hand
Joined: Mar 14, 2008
Posts: 107
|
|
Hi All
I'm getting a SQLException with description "Parameter Index out of range(1) number of parameters, which is (0).
Here's the code:
And the stack trace:
Why do I get this exception and where is the error in my code? Any help would be much appreciated...
|
Thanks & Regards
Swapna Gouri
I "try", I "catch" and "finally" WIN !!!
|
 |
Swastik Dey
Ranch Hand
Joined: Jan 08, 2009
Posts: 1237
|
|
Few mistakes in the code, those I could trace, as per your sql query there is no unknown parameters,
so I did not understand the use of pstmt.setString methods(so one cause of indexoutofbounds is happening here)
Secondly as per your query you are selecting only qtyoforder, but in the rs.next loop,
you are calling getString("customername")(one more cause of error)
|
Swastik
|
 |
Swapna Gouri Kalanidhi
Ranch Hand
Joined: Mar 14, 2008
Posts: 107
|
|
|
Thank you Swastik, it's working after modification... !
|
 |
 |
|
|
subject: SQLException:Parameter Index out of Range
|
|
|