Bug #57380 supportsMultipleResultSets() always returns false
Submitted: 11 Oct 2010 18:04 Modified: 13 Oct 2010 11:27
Reporter: Todd Farmer (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:5.1.13 OS:Any
Assigned to: Todd Farmer CPU Architecture:Any

[11 Oct 2010 18:04] Todd Farmer
Description:
DatabaseMetaData.supportsMultipleResultSets() is hard-coded to return false, but C/J has long supported multiple result sets:

            System.out.println("supportsMultipleResultSets():  " + md.supportsMultipleResultSets());
			conn.createStatement().execute("DROP PROCEDURE IF EXISTS testProc");
			conn.createStatement().execute("CREATE PROCEDURE testProc() BEGIN SELECT NOW(); SELECT 1; SELECT 2; END");
			Statement s = conn.createStatement();
			s.execute("CALL testProc()");
			do {
				ResultSet rs = s.getResultSet();
				rs.next();
				System.out.println("Result:  " + rs.getString(1));
			} 
			while (s.getMoreResults());

...

supportsMultipleResultSets():  false
Result:  2010-10-11 10:42:19.0
Result:  1
Result:  2

How to repeat:
DatabaseMetaData.supportsMultipleResultSets()

Suggested fix:
Return true when server version is >= 4.1.
[11 Oct 2010 18:08] Todd Farmer
Fixed in r983.
[13 Oct 2010 11:27] Tony Bedford
An entry has been added to the 5.1.14 changelog:

DatabaseMetaData.supportsMultipleResultSets() was hard-coded to return false, even though Connector/J supports multiple result sets.