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 Cost of creating 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 "Cost of creating DataSource..." Watch "Cost of creating DataSource..." New topic

Cost of creating DataSource...

Naveen Mishra
Ranch Hand

Joined: Nov 20, 2005
Posts: 75

Just curious to know how costly a call to Create DataSource and open a connection to database server can be.

Also, what could be impact of such calls if made very often in a web based n-tier application.

Thanks .
Mike Rainville
Ranch Hand

Joined: May 29, 2004
Posts: 36
You would want to use connection pooling, where sessions are recycled;
see import oracle.jdbc.pool.OracleDataSource

Naveen Mishra
Ranch Hand

Joined: Nov 20, 2005
Posts: 75
Hi .
Actually I meant what impact would it make on my application performance if such calls are made frequantly.
As of now , i'm using WSAD and working with pooled connections only.

But , due to some design issues , I need to make such calls frequently.
so, i wanted to know the seriousness of such calls. In my env , Db server is an independent system and Application(server) runs on a diff system.

Hope , now my query is a bit more open .

Thanks for giving thought to my query.
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33132

No more so than using the pooled connection directly. WebSphere (or any other app server) lets you pick the class used in the data source. So you can still use the pooled connection and get the same benefits. More in fact, since the app server can manage the connection.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Cost of creating DataSource...
It's not a secret anymore!