db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mamta Satoor <msat...@gmail.com>
Subject [PATCH] Updatable Resultset JDBC api (update and delete for forward only updatable resultsets) support for Network Server
Date Thu, 19 May 2005 09:46:19 GMT
Hi,
 Sometime back, I submitted patches for update and delete on forward only 
updatable resultsets using JDBC apis for Embedded Derby. With this mail, I 
would like to submit similar support for Network Server using Derby Net 
Client. 
 The functionality for Network Server is similar to what Embedded Derby 
supports, with the exception of following differences
1)DNC requires that the first column in the select list be from the target 
table.
eg select 1, c11 from t1 for update of c11 will fail in Network Server 
because driver looks at first column to determine the target table for 
update/delete. This is not required by embedded driver. There are tests for 
this in the attached patch(Positive Test2 in updatableResultSet.java).
2)Embedded driver allows Statement name change when there is an open 
resultset on that statement object. DNC driver does not supported that. 
(Positive Test8a and Test8b in updatableResultSet.java)
3)(Positive Test20) Embedded driver allows updateString on SMALLINT, 
INTEGER, BIGINT, DECIMAL datatypes. DNC doesn't.
Embedded driver support updateBytes on CHAR, VARCHAR, LONG VARCHAR 
datatypes. DNC doesn't
Embedded driver support updateTime on TIMESTAMP datatypes. DNC doesn't
Embedded driver supports updateObject with null value. DNC doesn't
DNC does not support updateClob and updateBlob
 Following files are changed by this patch
**************svn stat************
M 
java\testing\org\apache\derbyTesting\functionTests\tests\lang\updatableResultSet.java
M 
java\testing\org\apache\derbyTesting\functionTests\master\DerbyNetClient\updatableResultSet.out
M 
java\testing\org\apache\derbyTesting\functionTests\master\updatableResultSet.out
M 
java\testing\org\apache\derbyTesting\functionTests\master\jdk14\updatableResultSet.out
M java\testing\org\apache\derbyTesting\functionTests\suites\DerbyNet.exclude
M java\client\org\apache\derby\client\am\ResultSet.java
**********************************
 Following is a brief description of the actual changes that are going into 
the patch
1)After updateRow(provided updateXXX were issued on the row before 
updateRow) and deleteRow, position the resultset to right before the next 
row. This matches the embedded driver behavior.
2)If ResultSet is not positioned on a row and user issues updateRow (w/o 
prior updateXXX), then throw an exception that it is not a valid operation. 
This matches the embedded driver behavior.
3)Made changes to DNC so that it does not require all the updatable columns 
in the sql to be modified with updateXXX prior to updateRow. This matches 
the embedded driver behavior.
4)To preserve case sensitivity and spaces in the names, put quotes around 
database object names like table name, column name, cursor name etc. Similar 
to embedded driver.(Positive Test31a, Test31b)
5)For a select sql like, select 2, c11 from t1, Derby has null for table 
name and schema name for column 2. DNC needs to check for these nulls to 
avoid null pointer exception. 
 As always, please review the patch and let me know of any comments,
Mamta

Mime
View raw message