File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Best Practices1: A Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Best Practices1: A Question" Watch "Best Practices1: A Question" New topic
Author

Best Practices1: A Question

Mark Fletcher
Ranch Hand

Joined: Dec 08, 2001
Posts: 897
Hi there friends,
Im just getting into this Servlet and JSP business so that I can sit the SCWCD exam... Ive been working through the Core Servlets and Java Server Pages book by Marty Hall and I have a question regarding web.xml and JDBC settings...
Is there anything wrong with setting your JDBC settings in web.xml as a combination of <init-param> tags...
For example

Cheers,
Mark


Mark Fletcher - http://www.markfletcher.org/blog
I had some Java certs, but they're too old now...
L Goundalkar
Ranch Hand

Joined: Jul 05, 2001
Posts: 395
Hi,
There is nothing wrong in it.
If you are using the these parameters in your application to create connection or even connection pool and use it.
But in some servers you can explicitly create a datasource object which will have connection pool and you can use it in your custom application. This can be done in JRun.
In this case you need not worry about database properties at all.
Just check out with your application server about the Connection Pool feature and implement the same in your application. Then you need not worry about Connection Management.
Cheers.


<b>L G Goundalkar</b><br /> <a href="mailto:lggoundalkar@yahoo.com" rel="nofollow">lggoundalkar@yahoo.com</a> <br />Sun Certified Programmer for Java 2 Platform.<br />Sun Certified Web Component Developer for J2EE.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Best Practices1: A Question
 
Similar Threads
JDBC Parameters as Context Parameters?
Determining the location of the file
database connection from servlet
Authentication mechanism and code procedure from web app to an LDAP server
No Error Message But A Blank Page Is Displayed!!!