Issue Details (XML | Word | Printable)

Key: JDBC-381
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Mark Rotteveel
Reporter: Attila Molnár
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Jaybird JCA/JDBC Driver

execute procedure text blob result read via ResultSet.getString() returns null

Created: 22/Jan/15 12:22 PM   Updated: 25/Jan/15 01:17 PM
Component/s: JDBC driver
Affects Version/s: Jaybird 2.2.6
Fix Version/s: Jaybird 2.2.7

File Attachments: 1. Zip Archive TEST.ZIP (43 kB)

Environment: Firebird Server 2.5.2
Issue Links:
Relate
 


 Description  « Hide
Hi!

#1 : run non selectable procedure via CallableStatement which returns a text blob
#2 : read result via ResultSet.getString(1) -> empty string returned instead of the expected string

(PS : Jaybird 2.2.5 works fine)

Thank You!

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Mark Rotteveel added a comment - 22/Jan/15 12:37 PM - edited
This is probably caused by the changes for JDBC-350. Could you add a reproduction example (stored procedure + java code), so I can easily track it down and fix it?

Note that from a strict interpretation of JDBC, for an executable stored procedures you shouldn't use the ResultSet, but the getters on the CallableStatement instead. For Jaybird 2.2.x this should continue to work as it did in 2.2.5 and earlier, but there is no guarantee that this compatibility will be maintained in future Jaybird releases.

Attila Molnár added a comment - 22/Jan/15 01:24 PM
I use CallableStatement.getString(), I reported wrong in the first place. Test DB attached.
Code :

BasicDataSource ds = new BasicDataSource();
ds.setUsername("SYSDBA");
ds.setPassword("masterkey");
ds.setUrl("jdbc:firebirdsql:l3s-4/3051:d:\\\\test.fdb?charSet\\=UTF-8&TRANSACTION_READ_COMMITTED\\=isc_tpb_read_committed,isc_rec_version,isc_tpb_nowait&isc_dpb_sql_dialect=1");
Connection conn = ds.getConnection();
CallableStatement s = conn.prepareCall("EXECUTE PROCEDURE dyn_col_test");
s.execute();
String ret = s.getString(1);//problem!
System.out.print(ret);

Mark Rotteveel added a comment - 22/Jan/15 01:37 PM
Thanks, I will check and hopefully fix asap (probably this weekend).

Mark Rotteveel added a comment - 24/Jan/15 01:21 PM
In JDBC-350 I created a 'copy' of the result set for use with the getters of the CallableStatement, however creating such a copy will result in cached blobs (where the blob data is already loaded), however in this case the cached data is actually the blob id, and not the blob data.

Mark Rotteveel added a comment - 24/Jan/15 02:49 PM
Added option to FBCachedFetcher and FBResultSet to retrieve blobs when populated from an existing list of rows. This solves the problem.

I am considering releasing 2.2.7 with only this fix as it is a rather annoying breaking bug. I will make a final decision tomorrow (Sunday).

Mark Rotteveel added a comment - 25/Jan/15 01:17 PM