Hello,
there might be a problem in the latest JDBC-driver (9.2 build 1003) when querying double precision-result columns
multipletimes
and retrieving the result with ResultSet.getString():
The first five queries work as expected, further calls append ".0" to the result-string.
Here is a sample code:
PreparedStatement stmt = myConnection.prepareStatement("select cast(1 as double precision)");
for (int x=0;x<12;x++){
ResultSet rs = stmt.executeQuery();
while (rs.next()){
System.out.println("Value: " + rs.getString(1));
}
}
-------
Output:
-------
Value: 1
Value: 1
Value: 1
Value: 1
Value: 1
Value: 1.0
Value: 1.0
Value: 1.0
Value: 1.0
Value: 1.0
Value: 1.0
Value: 1.0
The problem does not occur when using JDBC-driver version 9.1;
I use PostgreSQL Version 9.3.0 (Win64/Vista)
Best regards,
Tilman Sandig