aspose file tools*
The moose likes JDBC 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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "I face a New java.sql.SQLException" Watch "I face a New java.sql.SQLException" New topic
Author

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
Bartender

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
Rancher

Joined: Mar 06, 2001
Posts: 13459

beerchug to you too
 
 
subject: I face a New java.sql.SQLException
 
Similar Threads
save Date() into mysql Timestamp
EJB Confusion (help the newbie)
What problem with this batch update ?
Getting strange exception while executing preparedStatement.
Inserting date into an MS Access DB