wood burning stoves 2.0*
The moose likes JDBC and the fly likes How to update from result set using new INNER JOIN syntax instead of WHERE clause? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to update from result set using new INNER JOIN syntax instead of WHERE clause?" Watch "How to update from result set using new INNER JOIN syntax instead of WHERE clause?" New topic
Author

How to update from result set using new INNER JOIN syntax instead of WHERE clause?

Siegfried Heintze
Ranch Hand

Joined: Aug 11, 2000
Posts: 381
There was an interesting discussion on the MSAccess newsgroup about the old way of doing SQL joins using the WHERE clause verses the new way using the INNER JOIN syntax.

If you are using the view feature (common to many databases including MSAccess) apparently there is an incentive to abandon the old WHERE clause (when possible) in favor of the new "INNER JOIN" syntax because the new "INNER JOIN" syntax allows you to specify which table will be updated when you

(1) update the view
(2) update the ADO.NET datatable (the Microsoft C# counterpart to a java/JDBC result set).

Apparently JDBC result sets have such similar feature like C#/ADO.NET where you just change the values in the result set (populated by a SELECT statement) and you don't have to code the INSERT/DELETE/UPDATE statements.

So do Java programmers have the same motivation to abandon the WHERE clause syntax like C# programmers?

How does the ResultSet class implement these updates? (I suppose I could look at the source but I was hoping someone already knew). Does it dynamically fabricate INSERT/UPDATE/DELETE statements on the fly and submit them to the database?

Thanks,
Siegfried

I don't recall seeing such a beast in JDBC. Is there some other framework layered on top of JDBC that has this feature? I'm sure hibernate does. Are there others?

I used eclipse and noticed that result sets have a log of update

Thanks,
Siegfried
Paul Campbell
Ranch Hand

Joined: Oct 06, 2007
Posts: 338
Siegfried, the joins you're describing are simply ANSI SQL, most RDBMS data bases support some form of it (Oracle adopted it in Oracle 8)... so I'm not really sure of the source of your discussion.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to update from result set using new INNER JOIN syntax instead of WHERE clause?