> -----Original Message----- > From: Fawaz Ahmad [mailto:[EMAIL PROTECTED]] > Sent: Monday, October 07, 2002 8:12 AM > To: [EMAIL PROTECTED] > Subject: best way to implement db pooling code > > > hello, > > is it better/more effient/professional to create a DataSource instance > variable and do the jndi lookup for the database only once > and use that > that IV each time the getConnection function is called, or is > it better to > call the lookup each time before the getConnection() is called.
The former one is better than the latter one. Since fetching the DataSource wastes resources i.e. so have to go to the network and get the connection. To avoid this its better to cache the datasource in a file on the users hard disk. > > Fuz Vikram. > > ______________________________________________________________ > _____________ > To unsubscribe, send email to [EMAIL PROTECTED] and > include in the body > of the message "signoff SERVLET-INTEREST". > > Archives: http://archives.java.sun.com/archives/servlet-interest.html > Resources: > http://java.sun.com/products/servlet/external-resources.html > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html > Disclaimer: This e-mail message along with any attachments is intended only for the addressee and may contain confidential and privileged information of GTL Limited. If the reader of this message is not the intended recipient, you are notified that any dissemination, distribution or copy of this communication is strictly prohibited. If you have received this message by error, please notify us immediately, return the original mail to the sender and delete the message from your system. ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html