This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes JDBC and Relational Databases 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

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Order in bind variable for PreparedStatement in Java" Watch "Order in bind variable for PreparedStatement in Java" New topic

Order in bind variable for PreparedStatement in Java

Stephane Philippart

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.


Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32508

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

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Order in bind variable for PreparedStatement in Java
jQuery in Action, 3rd edition