This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Created attachment 135120 [details] proposed patch v1 There is an outfall from the rework of the resultset fetching (SQLExecutionHelper.java). There are two issues fixed by the attached patch. - I tested with informix and it bailed out, because getUpdateCount was called twice. The language in http://docs.oracle.com/javase/6/docs/api/java/sql/Statement.html#getUpdateCount%28%29 was interpreted by IBM as 'getUpdateCount must not be called more than once'. The change reworks the fetching order to follow the advice given in http://docs.oracle.com/javase/6/docs/api/java/sql/Statement.html#getMoreResults%28%29 - testing derby I implemented a most simple stored procedure: public class Test { public static void selectRows(ResultSet[] data1, ResultSet[] data2) throws SQLException { Connection conn = DriverManager.getConnection("jdbc:default:connection"); PreparedStatement ps1 = conn.prepareStatement("select * from t1"); data1[0] = ps1.executeQuery(); PreparedStatement ps2 = conn.prepareStatement("select * from t2"); data2[0] = ps2.executeQuery(); conn.close(); } } and called it ... well it failed - derby does not like the combination of asking for a scrollable cursor and the nested resultsets. I moved the logic for determining whether scrollable resultsets are supported into the method updateScrollableSupport and there I check for the driver and the statement type.
http://hg.netbeans.org/core-main/rev/1e02f2d6fe2e Applied. Thank you, Matthias. A few notes: - I've fixed several "The assigned value is never used" warnings. I hope this doesn't break anything. - I've skipped "stmt.setFetchSize(Integer.MIN_VALUE);" change, supposing that the line was changed by mistake (setting negative value is not allowed, according to javadoc). - Removing condition "if (!needReread)" nested in "if (needReread)" condition, as it is never satisfied. - Expression "dc.getJDBCDriver().getClassName()" replaced with "dc.getDriverClass()", because it broke several tests. Please check the changes and if some of them are wrong, please let me know. Many thanks!
(In reply to comment #1) > - I've fixed several "The assigned value is never used" warnings. I hope this > doesn't break anything. Looks good! > - I've skipped "stmt.setFetchSize(Integer.MIN_VALUE);" change, supposing > that the line was changed by mistake (setting negative value is not allowed, > according to javadoc). Yeah - I was experimenting with mysql and streaming resultsets ... Sorry it should not have been in the patch. > - Removing condition "if (!needReread)" nested in "if (needReread)" condition, > as it is never satisfied. Nice catch :-) > - Expression "dc.getJDBCDriver().getClassName()" replaced with > "dc.getDriverClass()", because it broke several tests. Another nice one! Thanks for getting through the patch - I'm not sure what exactly went wrong on my side - I would have sworn, that I executed the test suite and removed the Integer.MIN_VALUE satement. I'll give it a spin once the changes migrate to main-golden.
Integrated into 'main-golden', will be available in build *201306012301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/1e02f2d6fe2e User: Jaroslav Havlin <jhavlin@netbeans.org> Log: #230515: Correct multiple resultsets Patch by Matthias42.