3. More APIs Become Available:
Some APIs and new methods have been added in JDBC 6.0.
More APIs have been added to this version of JDBC to provide access to
commonly implemented features of SQL:2003. In addition, several new methods have
been added to commonly used interfaces to support easier and better data
Now, let's review some working code and discuss the result of the Example1 class below. It will connect to an embedded Apache Derby database and display the query results in the console. Although JDBC 4.0 has been out for several months now, I found Apache Derby is the only database to provide a driver that even partially supports the JDBC 4.0 specification at the time of this writing (March 2007). All examples in this article are developed using JDK 1.6 and Apache Derby database version 10.2.2.0. For all code examples, I will show only snippets of the actual Java source file that are relevant to the discussion. See the Resources section for complete sample code discussed in this article.
4. Changes in Connection and Statement Interface:
Some new features have been added to the Connection interface.
However, first of all lets see the methods which are already in use to check whether
a Connection object is still valid/active or not.
int tenSeconds = 10;
In the above code the argument that specifies the time duration taken by the API to check whether the Connection is valid or not is Connection.isValid(int) that is Connection.isValid(tenSeconds);. This argument is the Timeout value. The value false will be returned if the timeout interval exceeds. And if the value returned is 0 for the time-out interval that indicates an Infinite Time-out Duration. Moreover the methods which are used for populating and retrieving the Client Information about a particular driver are:
also the methods which are used to retrieve the Client information individually are:
Now lets see the methods which have been added to the Statement interface.
Posted on: June 30, 2007 If you enjoyed this post then why not add us on Google+? Add us to your Circles