M
Max
Hello,
I am using JDBC driver
I would like to know if there is a way to display the SQL query associated
with a
PreparedStatement.
I would like to fill the parameters, and then display the query as it will
be thrown
to the Websphere server to debug my application.
Sample: PreparedStatement ps
= new connection.prepareStatement("Select * from foo where bar = ?") ;
ps.setInt(1, 1) ;
and then use somethind like:
// This line does not actually work. System.out.println("Query is: "
+ps.toString()) ;
// But i would like it to print Query is: Select * from foo where bar = 1
Thanks
I am using JDBC driver
I would like to know if there is a way to display the SQL query associated
with a
PreparedStatement.
I would like to fill the parameters, and then display the query as it will
be thrown
to the Websphere server to debug my application.
Sample: PreparedStatement ps
= new connection.prepareStatement("Select * from foo where bar = ?") ;
ps.setInt(1, 1) ;
and then use somethind like:
// This line does not actually work. System.out.println("Query is: "
+ps.toString()) ;
// But i would like it to print Query is: Select * from foo where bar = 1
Thanks