> I have question it is posible to see SQL query when I use
> PreparedStatement and print SQL query to console ?
Yes. But only with the ? not with the data.
Arne
> I have question it is posible to see SQL query when I use PreparedStatement
> and print SQL query to console ?
Not all drivers support this, and it's not part of the standard, but
many will allow you to call toString() (after you've set your
parameters) and see the SQL Statement.
Connector/J does this, the PostgreSQL driver does this as well. I
haven't tried jTDS or the JDBC/ODBC Bridge...
You may also find this useful:
http://www.javaworld.com/javaworld/jw-01-2002/jw-0125-overpower.html
Bomber - 16 Sep 2006 17:14 GMT
Thy this software, it intercepts the database call and prints out both
the original sql and the sql with the substitution values into a log
file.
http://www.p6spy.com/