| Author |
Obtaining The SQL from a prepared Statement
|
Abiodun Adisa
Ranch Hand
Joined: Jan 17, 2002
Posts: 495
|
|
I have a Prepared Statement insert into person(firstname,lastname) values(?,?); and I am setting the firstname and lastname via Preparedstmt.set(1,"ade"); Preparedstmt.set(2,"yomi"); and the last step is Preparestmt.executeUpdate(); The question i have is i am trying to obtain the SQL executed against the Database,after doing the set and executing the executeUpdate command which method can i use?
|
 |
Masoud Kalali
Author
Ranch Hand
Joined: Jul 08, 2004
Posts: 531
|
|
I do not know any direct way to do this, but you can start for example SQL server profiler and monitor the statement that is going to be executed in the database. Maybe you could enable logging in the JDBC driver level and see the prepared statement . to enable logging take a look at your driver manual and documenation.
|
Masoud Kalali
Software Engineer - My Weblog - GlassFish Security
|
 |
Jan Cumps
Bartender
Joined: Dec 20, 2006
Posts: 2343
|
|
You can use Ryan Bloom's logdriver. Regards, Jan
|
OCUP UML fundamental
ITIL foundation
|
 |
 |
|
|
subject: Obtaining The SQL from a prepared Statement
|
|
|