--Apple-Mail-4-935316676
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII; format=flowed


On Wednesday, January 1, 2003, at 06:57 PM, Gavin Sinclair wrote:

> On Thursday, January 2, 2003, 4:10:53 AM, David wrote:
>
>> Second, if you want to create utilities for dealing with result sets.
>> For example, in Java you can create (and I have created) an object 
>> that
>> buffers a result set and metadata.  If you are clever, you can track
>> changes, deletions, and additions to the data.  If you are really
>> clever, you can use the metadata to construct SQL to change the
>> database to match the buffer.  This allows you to instantiate a result
>> set object by sending it any SQL whatever, change the values in that
>> object, add rows to the object, and delete rows to the object, and 
>> then
>> simply call a "commit" method to have the object issue the appropriate
>> update, insert, and delete statements.  This type of a setup allows 
>> you
>> to eliminate hundreds or thousands of error-prone sql-computation 
>> lines
>> from your code.  Moreover, such an object makes an ideal superclass 
>> for
>> objects that correspond to database tables.
>
> This sounds really good.  Has anyone really *really* clever
> generalised all this and released it as a library (in any language)?
>
> Gavin
>

I wrote classes that did this in Java in 1998-1999 and used them in 
several projects for web driven database access (buffered result sets 
are perfect for web driven stuff, because the result sets will always 
be reasonably small).  They had some shortcomings, because at that time 
not all JDBC drivers were up to spec.  For example, the DB2 Type 3 and 
Type 4 drivers would always pass an empty string as the schema name.  
Oracle (as is always the case unless it is set correctly by a wise DBA 
at install time) had its screwy date format and didn't much like the 
default Sql.Date class.

I'd be happy to dig up the classes.  In the past when I've explained 
what they did, nobody expressed any interest.

Dave

-------------------------------------------------------
David King Landrith
   (w) 617.227.4469x213
   (h) 617.696.7133

One useless man is a disgrace, two
are called a law firm, and three or more
become a congress   -- John Adams
-------------------------------------------------------
public key available upon request


--Apple-Mail-4-935316676
content-type: application/pgp-signature; x-mac-type=70674453;
	name=PGP.sig
content-disposition: inline
content-transfer-encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (Darwin)

iD8DBQE+FFO3Rdirey0+rJARAhr8AKCEdPEVJ/KmMdXDxTrzTBQaHwfvfgCgmOz6
yVUR6HvtRXBE0hMBTHS2iq4=
=M+jL
-----END PGP SIGNATURE-----

--Apple-Mail-4-935316676--