Re: jsp postgresql problems

Поиск
Список
Период
Сортировка
От Nick Fankhauser
Тема Re: jsp postgresql problems
Дата
Msg-id NEBBLAAHGLEEPCGOBHDGEECFEIAA.nickf@ontko.com
обсуждение исходный текст
Ответ на jsp postgresql problems  ("Ryan Skoblenick" <webmaster@skoblenick.com>)
Список 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@ontko.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@postgresql.org
[mailto:pgsql-jdbc-owner@postgresql.org]On Behalf Of Ryan Skoblenick
Sent: Sunday, March 03, 2002 6:52 PM
To: pgsql-jdbc@postgresql.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


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: "Mihai Gheorghiu"
Дата:
Сообщение: Select for update
Следующее
От: Kovács Péter
Дата:
Сообщение: Re: Questions?