Getting sql for Callable or Prepared Statements

If I have a PreparedStatement or CallableStatement, and I want to get the sql that was specified when I created the statement from the connection, how do I get it?
[178 byte] By [dmbdmb] at [2007-9-26 1:52:11]
# 1
JDBC drivers sometimes provide an option which when put ON, the driver will log the actual SQLs to a log file.Don't know how to get the SQL using Java API though.
neville_sequeira at 2007-6-29 3:01:34 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...