File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes DataSource Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "DataSource" Watch "DataSource" New topic


Enkita mody
Ranch Hand

Joined: Aug 06, 2012
Posts: 333

The following sample code gets a DataSource object that produces connections to the database COFFEEBREAK and uses it to update a price in the table COFFEES:
The connection in this code sample participates in connection pooling because the following are true:

  • An instance of a class implementing ConnectionPoolDataSource has been deployed.
  • An instance of a class implementing DataSource has been deployed, and the value set for its dataSourceName property is the logical name that was bound to the previously deployed ConnectionPoolDataSource object.

  • Source:

    I couldn't figure out where this class is implementing ConnectionPoolDataSource interface as written above?

    I agree. Here's the link:
    subject: DataSource
    It's not a secret anymore!