File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes I face a New java.sql.SQLException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "I face a New java.sql.SQLException" Watch "I face a New java.sql.SQLException" New topic

I face a New java.sql.SQLException

Rajkumar balakrishnan
Ranch Hand

Joined: May 29, 2008
Posts: 445

When i use the below code it shows an weird error that i was not know before.
And here is my code....

And err here is the error

where the 201st line of RMAEntryModel is ps.setDate(1,da);

what should i do with...

Any help would be appreciated

Never try to be a hard-worker. Be a smart-worker.
My Blog
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

Parameter index out of range (1>0)

You are using a PreparedStatement but have not set any bind parameters. All your set methods have no where to bind their values.

To use PreparedStatements, you need to supply placeholders for the various set methods you call to bind their values. FOr example:

[ June 19, 2008: Message edited by: Paul Sturrock ]

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Rajkumar balakrishnan
Ranch Hand

Joined: May 29, 2008
Posts: 445

Thanks Paul Sturrock,

Now i cleared the error.Thanks for your help. Now i inserted the null values in my table. I have to move onto the next step of the project.

David O'Meara

Joined: Mar 06, 2001
Posts: 13459

beerchug to you too
I agree. Here's the link:
subject: I face a New java.sql.SQLException
jQuery in Action, 3rd edition