JDBC question: show PreparedStatement

From: Joolz <root_at_localhost.localdomain.invalid>
Date: 31 Jan 2008 09:35:40 GMT
Message-ID: <47a1966c$0$85795$e4fe514c_at_news.xs4all.nl>

Hello everyone,

A small question about JDBC. When I do something like this:

  PreparedStatement stmt = conn.prepareStatement("select * " +     "from fu where bar = ?");
  stmt.setString(1, "blah");
  System.out.println(stmt.toString()); // show me what will be asked

I would like to see which query will be sent to the DB (i.e. "select * from fu where bar = 'blah'"), which would be very nice for debugging. toString() won't do the trick (it gives something like "oracle.jdbc.driver.T4CPreparedStatement_at_1e859c0"). Is there a way to solve this? TIA! Received on Thu Jan 31 2008 - 10:35:40 CET

Original text of this message