File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and Relational Databases and the fly likes data source, connection and connection pool Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "data source, connection and connection pool" Watch "data source, connection and connection pool" New topic
Author

data source, connection and connection pool

Hari babu
Ranch Hand

Joined: Jun 25, 2001
Posts: 208
Hi all,
Whats the difference between data source and connection ?
Thanks in advance
Hari
Ken Robinson
Ranch Hand

Joined: Jul 25, 2002
Posts: 52
A DataSource is usually a group of Connections. Many web/app severs allow for the creation of a DataSource via a config file/tool.
Basically, if you have an app that access that database frequently, a DataSource is the way to go. If you develop a web store front, you want everyone to be able to view your catalog. It would not be very performant to create a dedicated Connection for each new user. This would cause a large number of new Connections (which is expensive) for a user that will use it only briefly. The DataSource allows a request to grab a Connection, use it, and put it back in the pool when complete. The eliminates the steps of creating a new Connection and storing a possibly high number of Connections.
Most servers allow you to set the number of Connections in a pool at start, the number to increment if that is not enough and a maximum number to user.
Fergus Red
Ranch Hand

Joined: Apr 25, 2002
Posts: 42
cheers for the help
Hari babu
Ranch Hand

Joined: Jun 25, 2001
Posts: 208
Hi,
How diffrent is the data source from connection pool ?
Hari
Anthony Villanueva
Ranch Hand

Joined: Mar 22, 2002
Posts: 1055
Originally posted by Hari babu:
Hi,
How diffrent is the data source from connection pool ?
Hari

Perhaps you should try this
link. It discusses how to use a pooled connection using a DataSource (3.7 to 3.7.4)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: data source, connection and connection pool