This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 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!