Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Database Connection

Reply
Thread Tools

Database Connection

 
 
thammerlund
Guest
Posts: n/a
 
      07-07-2006
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("jdbcostgresq l://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

 
Reply With Quote
 
 
 
 
Jon Martin Solaas
Guest
Posts: n/a
 
      07-07-2006
thammerlund wrote:

> 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 ...
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Database Database Database scott93727@gmail.com Computer Information 0 09-27-2012 02:43 AM
DataBase DataBase DataBase DataBase scott93727@gmail.com Computer Information 0 09-26-2012 09:40 AM
Database Connection - Not Associated With Trusted Connection Mythran ASP .Net 5 10-05-2005 10:50 PM
Re: Software Developer to transcribe Oracle database into Access database Fluker MCSD 0 07-09-2003 01:20 PM
Re: Software Developer to transcribe Oracle database into Access database Guy Cox MCSD 1 07-09-2003 08:07 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57