Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Comparing features in JDBC & ADO.NET

 
Christopher Benson
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the .NET Beta, ADO.NET has a feature that I'm hoping that JDBC has. In ADO.NET you can create a completely disconnected dataset (same as a resultset) that can be a combination of data from many different database tables.
Example:
SELECT A.a, B.b, C.c FROM (A INNER JOIN B WHERE A.z=B.z) INNER JOIN C WHERE C.z=A.z)
You can have an ADO.NET datatable that combines info from each of three different database tables. The dataset that holds this particular datatable is completely disconnected and can be passed around to many objects for modification. Then it can be returned to the data access component and the database can be updated in all the relevent tables with updates, inserts, deletes, etc., That ADO.NET dataset is a full-fledged virtual database with meta-data that records all these actions.
Can JDBC do that with a resultset that accesses multiple database tables using only a single SQL statement & resultset? I'm really hoping so, but haven't been able to find that feature yet. Thanks.
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Christopher Benson:
Can JDBC do that with a resultset that accesses multiple database tables using only a single SQL statement & resultset? I'm really hoping so, but haven't been able to find that feature yet. Thanks.

Investigate javax.sql.CachedRowSet from the JDBC 2 optional package. Updating a dataset produced by a join can be tricky - in any framework - but you can write a custom handler (RowSetWriter) to support it.
The javax.sql.* package will be a standard part of J2SE 1.4, by the way.
- Peter
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic