This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Kubernetes in Action and have Marko Luksa on-line!
See this thread for details.
Win a copy of Kubernetes in Action this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Data Source or Driver Manager - Performance Issues?  RSS feed

 
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)
 
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!