How do find debugging problems related to JDBC API?

Answer Posted / aditi

A good way to find out what JDBC calls are doing is to
enable JDBC tracing. The JDBC trace contains a detailed
listing of the activity occurring in the system that is
related to JDBC operations.

If you use the DriverManager facility to establish your
database connection, you use the DriverManager.setLogWriter
method to enable tracing of JDBC operations. If you use a
DataSource object to get a connection, you use the
DataSource.setLogWriter method to enable tracing. (For
pooled connections, you use the
ConnectionPoolDataSource.setLogWriter method, and for
connections that can participate in distributed
transactions, you use the XADataSource.setLogWriter method.)

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to connect multiple database in jdbc?

482


What is the significance of DataBaseMetaData.tableIndexStatistics? How to obtain and use it?

509


What is the use of the statement in jdbc?

485


What is difference between java.util.Date and java.sql.Date?

525


Can I use JDBC to execute non-standard features that my DBMS provides?

549






Why do we use jdbc statements?

503


What is new in JDBC 2.0?

568


What is a connection string used for?

500


How do I stop nullpointerexception?

504


If I use the JDBC API, do I have to use ODBC underneath?

595


What is the advantage of namedparameterjdbctemplate?

503


How to set NULL values in JDBC PreparedStatement?

535


What do you mean by odbc?

541


Is possible to open a connection to a database with exclusive mode with JDBC?

536


What is JDBC ResultSet?

588