Re: jsp postgresql problems

From: "Nick Fankhauser" <nickf(at)ontko(dot)com>
To: "Ryan Skoblenick" <webmaster(at)skoblenick(dot)com>, <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: jsp postgresql problems
Date: 2002-03-07 16:39:49
Message-ID: NEBBLAAHGLEEPCGOBHDGEECFEIAA.nickf@ontko.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

A couple of thoughts/questions-

You don't need to instantiate the driver if you load it in your code, so you
can use this instead of the code you posted:

<%
Class.forName("org.postgresql.Driver"); Connection conn =
java.sql.DriverManager.getConnection("jdbc:postgresql://localhost:5432/db_na
me", "username", "password");
%>

Does ASP actually use TCP/IP to communicate with the DB? (I'm not very
familiar with it.)

Have you tried just a plain vanilla connection to the database that doesn't
involve a JSP? Doing that would help isolate the cause to something that is
servlet/JSP-related or something that is JDBC-related.

-NickF

--------------------------------------------------------------------------
Nick Fankhauser nickf(at)ontko(dot)com Phone 1.765.935.4283 Fax 1.765.962.9788
Ray Ontko & Co. Software Consulting Services http://www.ontko.com/

-----Original Message-----
From: pgsql-jdbc-owner(at)postgresql(dot)org
[mailto:pgsql-jdbc-owner(at)postgresql(dot)org]On Behalf Of Ryan Skoblenick
Sent: Sunday, March 03, 2002 6:52 PM
To: pgsql-jdbc(at)postgresql(dot)org
Subject: [JDBC] jsp postgresql problems

This is my code:
<%@ page import ="java.sql.*" %>
<%
Driver drv = (Driver)Class.forName("org.postgresql.Driver").newInstance();
Connection conn =
java.sql.DriverManager.getConnection("jdbc:postgresql://localhost:5432/db_na
me", "username", "password");
%> now the stack error i am running into is:
Connection refused. Check that the hostname and port is correct, and that
the postmaster is running with the -i flag, which enables TCP/IP networking.
i know its not the server or the way it is setup cause i can connect to the
DB in ASP? so what is wrong with the JSP? i do have the drivers installed
for postgresql cause the first error before this i was getting was that it
couldn't find the drivers (silly me forgot to reset the server).
anyone help ?
Thanks

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kovács Péter 2002-03-07 16:59:40 Re: Questions?
Previous Message Mihai Gheorghiu 2002-03-07 14:57:34 Select for update