Hi,
Derby does not support scroll sensitive updatable resultsets. There is
already a test for this in embedded mode. Enabling the same test for
Network Server. The new Derby Net Client driver will correctly
downgrade the resultset type to scroll insensitive read only
resultset. JCC driver does not do that and there is already a JIRA
entry 154 for it.
svn stat
M java\testing\org\apache\derbyTesting\functionTests\tests\lang\updatableRe
sultSet.java
M java\testing\org\apache\derbyTesting\functionTests\master\DerbyNet\updata
bleResultSet.out
M java\testing\org\apache\derbyTesting\functionTests\master\DerbyNetClient\
updatableResultSet.out
M java\testing\org\apache\derbyTesting\functionTests\master\updatableResult
Set.out
M java\testing\org\apache\derbyTesting\functionTests\master\jdk14\updatable
ResultSet.out
thanks,
Mamta
Index: java/testing/org/apache/derbyTesting/functionTests/tests/lang/updatableResultSet.java
===================================================================
--- java/testing/org/apache/derbyTesting/functionTests/tests/lang/updatableResultSet.java (revision 158774)
+++ java/testing/org/apache/derbyTesting/functionTests/tests/lang/updatableResultSet.java (working copy)
@@ -247,7 +247,6 @@
//have to close the resultset because by default, resultsets are held open over commit
rs.close();
- if (TestUtil.isEmbeddedFramework()) {
System.out.println("Negative Test2 - request for scroll sensitive updatable resultset will give a read only scroll insensitive resultset");
stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
while (warnings != null)
@@ -257,6 +256,7 @@
}
conn.clearWarnings();
System.out.println("requested TYPE_SCROLL_SENSITIVE, CONCUR_UPDATABLE but that is not supported");
+ System.out.println("Jira issue Derby-154 : When client connects to Network Server using JCC, it incorrectly shows support for scroll sensitive updatable resultsets");
System.out.println("Make sure that we got TYPE_SCROLL_INSENSITIVE? " + (stmt.getResultSetType() == ResultSet.TYPE_SCROLL_INSENSITIVE));
System.out.println("Make sure that we got CONCUR_READ_ONLY? " + (stmt.getResultSetConcurrency() == ResultSet.CONCUR_READ_ONLY));
System.out.println("JDBC 2.0 updatable resultset api will fail on this resultset because this is not an updatable resultset");
@@ -281,7 +281,6 @@
rs.next();
//have to close the resultset because by default, resultsets are held open over commit
rs.close();
- }
System.out.println("Negative Test3 - request a read only resultset and attempt deleteRow and updateRow on it");
stmt = conn.createStatement();//the default is a read only forward only resultset
Index: java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/updatableResultSet.out
===================================================================
--- java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/updatableResultSet.out (revision 158774)
+++ java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/updatableResultSet.out (working copy)
@@ -12,6 +12,16 @@
Got expected exception This method cannot be invoked while the cursor is on the insert row or if the concurrency of this ResultSet object is CONCUR_READ_ONLY.
SQL State : null
Got expected exception This method cannot be invoked while the cursor is on the insert row or if the concurrency of this ResultSet object is CONCUR_READ_ONLY.
+Negative Test2 - request for scroll sensitive updatable resultset will give a read only scroll insensitive resultset
+requested TYPE_SCROLL_SENSITIVE, CONCUR_UPDATABLE but that is not supported
+Jira issue Derby-154 : When client connects to Network Server using JCC, it incorrectly shows support for scroll sensitive updatable resultsets
+Make sure that we got TYPE_SCROLL_INSENSITIVE? false
+Make sure that we got CONCUR_READ_ONLY? false
+JDBC 2.0 updatable resultset api will fail on this resultset because this is not an updatable resultset
+SQL State : null
+Got expected exception This method cannot be invoked while the cursor is on the insert row or if the concurrency of this ResultSet object is CONCUR_READ_ONLY.
+SQL State : null
+Got expected exception This method cannot be invoked while the cursor is on the insert row or if the concurrency of this ResultSet object is CONCUR_READ_ONLY.
Negative Test3 - request a read only resultset and attempt deleteRow and updateRow on it
Make sure that we got CONCUR_READ_ONLY? true
Now attempting to send a deleteRow on a read only resultset.
Index: java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/updatableResultSet.out
===================================================================
--- java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/updatableResultSet.out (revision 158774)
+++ java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/updatableResultSet.out (working copy)
@@ -12,6 +12,16 @@
Got expected exception This method cannot be invoked while the cursor is on the insert row or if the concurrency of this ResultSet object is CONCUR_READ_ONLY.
SQL State : null
Got expected exception This method cannot be invoked while the cursor is on the insert row or if the concurrency of this ResultSet object is CONCUR_READ_ONLY.
+Negative Test2 - request for scroll sensitive updatable resultset will give a read only scroll insensitive resultset
+requested TYPE_SCROLL_SENSITIVE, CONCUR_UPDATABLE but that is not supported
+Jira issue Derby-154 : When client connects to Network Server using JCC, it incorrectly shows support for scroll sensitive updatable resultsets
+Make sure that we got TYPE_SCROLL_INSENSITIVE? true
+Make sure that we got CONCUR_READ_ONLY? true
+JDBC 2.0 updatable resultset api will fail on this resultset because this is not an updatable resultset
+SQL State : null
+Got expected exception This method cannot be invoked while the cursor is on the insert row or if the concurrency of this ResultSet object is CONCUR_READ_ONLY.
+SQL State : null
+Got expected exception This method cannot be invoked while the cursor is on the insert row or if the concurrency of this ResultSet object is CONCUR_READ_ONLY.
Negative Test3 - request a read only resultset and attempt deleteRow and updateRow on it
Make sure that we got CONCUR_READ_ONLY? true
Now attempting to send a deleteRow on a read only resultset.
Index: java/testing/org/apache/derbyTesting/functionTests/master/updatableResultSet.out
===================================================================
--- java/testing/org/apache/derbyTesting/functionTests/master/updatableResultSet.out (revision 158774)
+++ java/testing/org/apache/derbyTesting/functionTests/master/updatableResultSet.out (working copy)
@@ -14,6 +14,7 @@
Got expected exception 'updateRow' not allowed because the ResultSet is not an updatable ResultSet.
Negative Test2 - request for scroll sensitive updatable resultset will give a read only scroll insensitive resultset
requested TYPE_SCROLL_SENSITIVE, CONCUR_UPDATABLE but that is not supported
+Jira issue Derby-154 : When client connects to Network Server using JCC, it incorrectly shows support for scroll sensitive updatable resultsets
Make sure that we got TYPE_SCROLL_INSENSITIVE? true
Make sure that we got CONCUR_READ_ONLY? true
JDBC 2.0 updatable resultset api will fail on this resultset because this is not an updatable resultset
Index: java/testing/org/apache/derbyTesting/functionTests/master/jdk14/updatableResultSet.out
===================================================================
--- java/testing/org/apache/derbyTesting/functionTests/master/jdk14/updatableResultSet.out (revision 158774)
+++ java/testing/org/apache/derbyTesting/functionTests/master/jdk14/updatableResultSet.out (working copy)
@@ -14,6 +14,7 @@
Got expected exception 'updateRow' not allowed because the ResultSet is not an updatable ResultSet.
Negative Test2 - request for scroll sensitive updatable resultset will give a read only scroll insensitive resultset
requested TYPE_SCROLL_SENSITIVE, CONCUR_UPDATABLE but that is not supported
+Jira issue Derby-154 : When client connects to Network Server using JCC, it incorrectly shows support for scroll sensitive updatable resultsets
Make sure that we got TYPE_SCROLL_INSENSITIVE? true
Make sure that we got CONCUR_READ_ONLY? true
JDBC 2.0 updatable resultset api will fail on this resultset because this is not an updatable resultset