aspose file tools*
The moose likes JDBC and the fly likes Comparing features in JDBC & ADO.NET Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Comparing features in JDBC & ADO.NET" Watch "Comparing features in JDBC & ADO.NET" New topic
Author

Comparing features in JDBC & ADO.NET

Christopher Benson
Greenhorn

Joined: Jun 05, 2001
Posts: 1
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

Joined: Apr 20, 2000
Posts: 3252
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Comparing features in JDBC & ADO.NET