File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and the fly likes Data Source or Driver Manager - Performance Issues? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Data Source or Driver Manager - Performance Issues?" Watch "Data Source or Driver Manager - Performance Issues?" New topic

Data Source or Driver Manager - Performance Issues?

Azrael Noor
Ranch Hand

Joined: Jul 29, 2010
Posts: 378
In Driver Manager class, i open connection do process close it.....

> open connection
> check if previous connection is there
> pick it
> process db operation
> if required then close it
> else keep it using and close after some hundreds of queries.

In Datasource Connection, i have read that Connection is created by App Server.

What is performance differences between two.

As i am runninng 430 queries using Driver Manager(takes 10 to 20 Seconds) and if shift to DataSource then does it effect time if yes how much?

(I am not using Hibernate or ORM tool, simple SQL packages of Java and javax)

Azrael Noor
Jelle Klap

Joined: Mar 10, 2008
Posts: 1665

As far as obtaining a Connection, it depends on the implementation of the DataSource interface. An implementation might create a new Connection instance for every invocation of getconnection(), or it may be backed by a pool of Connection objects. The former would be on-par with how a Connection is created by the DriverManager class. The latter would be more efficient as Connections are reused instead of recreated over and over. This approach is very commonly used by applications deployed in servlet containers / application servers.

Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
I agree. Here's the link:
subject: Data Source or Driver Manager - Performance Issues?
Similar Threads
Hibernate with Application server connection pool
Issue Connecting to MS SQL Server using WAS Embedded connectjdbc Driver
Database connectivity taking too much time
connecting sqlserver2000
SQLException invalid cursor