Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Java
PostgreSQL/Eclipse/Tomcat - How to connect to DB?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Bryan Castillo, post: 587824"] Thomas Hoheneder wrote: I'm sure you got that to compile, but did it work? I didn't think that JDBC drivers registered themselves properly when their classes are loaded from a class loader different from the system class loader. (Since you put the postgress jar in WEB-INF/lib it is probably under a custom class loader created by your J2EE container.) I believe Tomcat docs say to put jdbc driver jars into one of tomcats lib directories, I forget which one now. Anyway, you might want to read about Tomcats connection pooling. You can set up a database connection pool through its UI and get connections through JNDI. Thats the probably a better way to retrieve database connections for your servlet. It will also keep hardcoded usernames and passwords out of your source files. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Java
PostgreSQL/Eclipse/Tomcat - How to connect to DB?
Top