File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes SQL error:java.sql.SQLException: ORA-01008: not all variables bound Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "SQL error:java.sql.SQLException: ORA-01008: not all variables bound" Watch "SQL error:java.sql.SQLException: ORA-01008: not all variables bound" New topic
Author

SQL error:java.sql.SQLException: ORA-01008: not all variables bound

Reggie McDougal
Ranch Hand

Joined: Sep 27, 2004
Posts: 69
I'm getting ORA-01008 when I run the following INSERT
statement, product_id is a PK and a number column, as I am using
"setString" should this be a long when I INSERT?

I'm using Oracle 8.1

REG




[edited to remove whitespace from beginning of lines so page doesn't scroll right]
[ January 27, 2005: Message edited by: Jeanne Boyarsky ]

You can never drink too much
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30752
    
156

Reggie,
It's better to use a long because it clearly expresses the intent of the setter and eliminates the possiblity of a database exception caused by an poorly formatted a string.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
You had 6 twice and didn't set something for 7.
cheers.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SQL error:java.sql.SQLException: ORA-01008: not all variables bound