Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2006

Tip: Looking for answers? Try searching our database.

Database Connection

Thread view: 
thammerlund - 07 Jul 2006 08:18 GMT
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
Jon Martin Solaas - 07 Jul 2006 16:29 GMT
> I'm not having any success.  

What exactly makes you think you don't have any success? Is there an
error message perhaps? Surely the webpage doesn't output anything ...


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.