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
Database Connection
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="thammerlund, post: 1603947"] Hi everyone, I'm just starting to learn JAVA/JSP, and I'm at the point where I'm trying to connect to a PostgreSQL 8.1 database through Tomcat 5.5, but I'm not having any success. My Page code is as follows: <html> <head> </head> <%@ page language="java" import="java.sql.*" %> <body> <% public Statement dbStatement; dbStatement = dbConnection.createStatement(); Class.forName("org.postgresql.Driver"); Connection myConn=DriverManager.getConnection("jdbc:postgresql://localhost/PostgreDB?user=postgres&password=postgres"); Conn = setDbConnection(PostgreDB) %> </html> Is there something wrong with the code, or is it the web.xml or server.xml file? I put the postgresql-8.1-405.jdbc3.jar file in WEB-INF/lib. Thank you, Tom [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Java
Database Connection
Top