Re: jsp postgresql problems

From: "Joe Shevland" <jshevland(at)j-elite(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 22:51:48
Message-ID: HEECIHEEJDBMCCGMGIOBOEGLCFAA.jshevland@j-elite.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

JSP (any Java) will use TCP/IP via the driver... you may need to tweak
your pg_hba.conf file to allow TCP/IP connections from localhost, or add
the -i flag when starting postmaster up as this enables the server socket.

Cheers,
Joe

PS You can omit the port number 5432 from the connection string as this is
the default, even 'jdbc:postgresql:db_name' will work for local
connections (and as Nick mentioned you don't need the newInstance()
method, drivers you do need it for are breaking the spec).

-----Original Message-----
From: pgsql-jdbc-owner(at)postgresql(dot)org
[mailto:pgsql-jdbc-owner(at)postgresql(dot)org]On Behalf Of Ryan Skoblenick
Sent: Monday, 4 March 2002 10:52
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_
name", "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 Joe Shevland 2002-03-07 23:12:14 Re: PostgreSQL and MacOS X
Previous Message adr rrp pub 2002-03-07 22:48:43 PostgreSQL and MacOS X