• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

ResultSet.updateInt(...) generated sql

 
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Currently we are using MySQL and the JDBC connector for our application. In some cases we are doing :

ResultSet rset ....
rset.moveToInsertRow();

...
...
rset.updateInt(...).



I have a simple question, is there a easy way to get the SQL generated by this statement programatically? We are looking at implementing MySQL bin-log alternatives for the app.
 
Marshal
Posts: 26912
82
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not too likely. The SQL would look something like this:

UPDATE table SET field = value WHERE primarykey = value

Most of that could be done, but your code doesn't know which column is the primary key. MySQL does (if there isn't one, it will complain) but your code doesn't. Unless perhaps you had a convention where the primary key is the first column, or something like that.
 
Thomas Mcfarrow
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Basically I am trying to implement a MySQL bin-log that saved in the database. The alternative is to write bridge code that will move the log to a table.

Or remove the updatable resultsets. IMHO, updatable resultsets are slower than a straight insert or update.

The whole idea was not exposing db architecture to the client.
 
reply
    Bookmark Topic Watch Topic
  • New Topic