Monday, January 19, 2009

A.3.4 Other New Features

The JDBC 2.0 core API provides various other new features, which are summarized in the following list.

• Performance enhancements-new methods that allow a programmer to fine tune the retrieval of rows from the database. These methods provide the ability to specify (1) the number of result set rows fetched from the database when more rows are needed and (2) the direction in which rows are fetched from the database.

• ResultSet methods for getting and setting the current fetch size and fetch direction
• Statement, PreparedStatement, and CallableStatement methods for getting and setting the default fetch size and default fetch direction that result sets generated by executing a query will have when they are first created

• Character streams-new methods that allow character data to be retrieved or sent to the database as a stream of internationalized Unicode characters. These methods replace the deprecated getUnicodeStream and setUnicodeStream methods.

• ResultSet.getCharacterStream
• CallableStatement.getCharacterStream
• PreparedStatement.setCharacterStream

• Full precision for java.math.BigDecimal values-new versions of themethods that retrieve a java.math.BigDecimal value with full precision. Unlike the deprecated versions they replace, these new versions do not take a specified precision.

• ResultSet.getBigDecimal
• CallableStatement.getBigDecimal

• Support for time zones-methods with new versions that take a Calendar object as a parameter, which allows the driver to use a specified time zone rather than the default when calculating a value for a date, time, or timestamp

• ResultSet.getDate
• ResultSet.getTime
• ResultSet.getTimestamp
• CallableStatement.getDate
• CallableStatement.getTime
• CallableStatement.getTimestamp
• PreparedStatement.setDate
• PreparedStatement.setTime
• PreparedStatement.setTimestamp

0 Comments: