Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Siegfried Heintze
Ranch Hand
Posts: 408
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 338
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic