How can I write to the log used by DriverManager and JDBC drivers?How can I write to the log used by DriverManager and JDBC drivers?

The simplest method is to use DriverManager.println(String message), which will write to the current log.

What does it mean to “materialize” data?

This term generally refers to Array, Blob and Clob data which is referred to in the database via SQL locators. “Materializing” the data means to return the actual data pointed to by the Locator.   For Arrays, use the various forms of getArray() and getResultSet().   For Blobs, use getBinaryStream() or getBytes(long pos, int length). [...]

How do I insert/update records with some of the columns having NULL value?

Use the following method of PreparedStatement:   public void setNull(int parameterIndex, int sqlType) throws SQLException

Why can’t Tomcat find my Oracle JDBC drivers in classes111.zip?

  TOMCAT throws the following exception when i try to connect to Oracle DB from JSP.   javax.servlet.ServletException : oracle.jdbc.driver.OracleDriver   Root Cause : java.lang.ClassNotFoundException: oracle:jdbc:driver:OracleDriver     But, the Oracle JDBC driver ZIP file (classes111.zip)is available in the system classpath.   The problem can be solved by using the following procedure:      1. [...]

What is a JDBC 2.0 DataSource?

The DataSource class was introduced in the JDBC 2.0 Optional Package as an easier, more generic means of obtaining a Connection. The actual driver providing services is defined to the DataSource outside the application (Of course, a production quality app can and should provide this information outside the app anyway, usually with properties files or [...]

What is optimistic concurrency?

An optimistic approach dispenses with locks (except during the actual update) and usually involves comparison of timestamps, or generations of data to ensure that data hasn’t changed between access and update times. It’s generally explained that the term optimistic is used because the expectation is that a clash between multiple updates to the same data [...]

What is pessimistic concurrency?

With a pessimistic approach, locks are used to ensure that no users, other than the one who holds the lock, can update data. It’s generally explained that the term pessimistic is used because the expectation is that many users will try to update the same data, so one is pessimistic that an update will be [...]

What is the difference between setMaxRows(int) and SetFetchSize(int)? Can either reduce processing time?

setFetchSize(int) defines the number of rows that will be read from the database when the ResultSet needs more rows. The method in the java.sql.Statement interface will set the ‘default’ value for all the ResultSet derived from that Statement; the method in the java.sql.ResultSet interface will override that value for a specific ResultSet. Since database fetches [...]

What is JDO?

JDO provides for the transparent persistence of data in a data store agnostic manner, supporting object, hierarchical, as well as relational stores.

Where is console output sent (System.out/System.err) in stored procedures written in Java?

With Oracle, console output from System.out.println() statements will be written to trace files in the Oracle UDUMP destination directory.

Follow

Get every new post delivered to your Inbox.