This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Binding in Prepared Statement is not working with Microsoft SQL Server JDBC Driver sqljdbc4.jar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Binding in Prepared Statement is not working with Microsoft SQL Server JDBC Driver sqljdbc4.jar" Watch "Binding in Prepared Statement is not working with Microsoft SQL Server JDBC Driver sqljdbc4.jar" New topic
Author

Binding in Prepared Statement is not working with Microsoft SQL Server JDBC Driver sqljdbc4.jar

Charan Teja Sri Rama
Greenhorn

Joined: Dec 23, 2011
Posts: 3
I ran the following program with sqljdbc4.jar in the classpath. There is data in the EMPLOYEE table for the employee name DEMO but the following program is not retrieving data for DEMO. When the same program was run with Merlia.jar in the classpath, it was retrieving data for DEMO.

Did anyone faced these types of issues with sqljdbc4.jar?Are there any flaws in thesqljdbc4.jar?
Can someone help me out from this issue.
Paul Clapham
Sheriff

Joined: Oct 14, 2005
Posts: 19692
    
  10

The JDBC specs don't say what the result of toString() on a ResultSet should be, so drivers are free to implement that method in any way at all. So it shouldn't be surprising to find that different drivers have different implementations of it.

If you want to discuss "flaws", I would say that using a ResultSet in that way is a bad idea. Stick to the way you saw in the tutorials.
Charan Teja Sri Rama
Greenhorn

Joined: Dec 23, 2011
Posts: 3
I have used the rs.getString(1) in the system.out.print statement but even then there is no output observed on the console. The problem may be with the setString() method.
Can you send me the program where ResultSet is not used.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Binding in Prepared Statement is not working with Microsoft SQL Server JDBC Driver sqljdbc4.jar
 
jQuery in Action, 3rd edition