• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Data Source or Driver Manager - Performance Issues?

 
Azrael Noor
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
 
Jelle Klap
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic