aspose file tools*
The moose likes JDBC and the fly likes Order in bind variable for PreparedStatement in Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Order in bind variable for PreparedStatement in Java" Watch "Order in bind variable for PreparedStatement in Java" New topic
Author

Order in bind variable for PreparedStatement in Java

Stephane Philippart
Greenhorn

Joined: Jul 29, 2004
Posts: 12
Hi everybody,

Sorry for my poor english and the size of the post.

I have a critical problem with a prepared query and bind variable in Java.

I try to execute the following query which do return one row :

The tce column is a decimal, age column a varchar and cli a varchar


with the following values :

No rows are returned.

If I don't respect the order of the bind variable like this :

The correct row is returned.

I am confused because it seems that the jdbc driver bind the variable first in the inner join and after in my case ... when inspite their order in the query.

The same query work perfectly under Oracle whit the good order for the bind variables.

My informix database is 9.40.UC2
My Jdbc informix driver is 2.21.JC5

If anybody have an explaination.

thanks

Stef
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30537
    
150

Stef,
Sounds like a bug in the driver. Are there any other Informix drivers you can use?


[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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Order in bind variable for PreparedStatement in Java