This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes out of range Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "out of range" Watch "out of range" New topic
Author

out of range

D Ravi Kumar
Greenhorn

Joined: Dec 11, 2008
Posts: 4


i got the these error


filename:::::>>>>true
java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).
at com.mysql.jdbc.PreparedStatement.setInternal(PreparedStatement.java:2085)
at com.mysql.jdbc.PreparedStatement.setString(PreparedStatement.java:1182)
at com.izmocars.inventory.homenet.Test.main(Test.java:69)


give me solution

Regards
Ravi Kumar
[ December 11, 2008: Message edited by: Ulf Dittmer ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41181
    
  45
Welcome to JavaRanch.

You need to remove the quotation marks from the parameters. JDBC will automatically add those where necessary.

In the future, please UseCodeTags when posting code of any length. As it was, the code was basically unreadable.

(As an aside, I think you meant to say "please give me a solution".)


Ping & DNS - my free Android networking tools app
D Ravi Kumar
Greenhorn

Joined: Dec 11, 2008
Posts: 4
Simply change the below statement

statement.executeUpdate();

your statement is
statement.executeUpdate(query);

remove the "query"
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: out of range
 
Similar Threads
java.lang.NoSuchMethodError for org.apache.poi.hssf.usermodel.HSSFPatriarch.createComment()
assignment help
Help with used car program
org.xml.sax.SAXParseException
variable in place of object?