Skip site navigation (1) Skip section navigation (2)

JDBC

From: Elie Atallah <Elie(dot)Atallah(at)igd(dot)fhg(dot)de>
To: pgsql-bugs(at)postgresql(dot)org
Subject: JDBC
Date: 2000-11-14 16:16:49
Message-ID: 3A116571.A4EFEBD8@igd.fhg.de (view raw or flat)
Thread:
Lists: pgsql-bugs
Hello postgresql team,

I'am trying to connect to the posgresql database through JDBC and it
doesn't function.

1. I have made the postgresql.jar through the command "make jdbc2" -as
it is described in /src/interfaces/jdbc/  source- and it is copied to my
CLASSPATH
2. I have an access to the database through "psql" (the name of the
database is "test").
3.with this piece of code I'am trying to connect the data base:


 Class.forName("org.postgresql.Driver");    // load database interface
        // connect to the database
         String url = "jdbc:postgresql://gemini:6666/test";
         conn = DriverManager.getConnection(url);

/*gemini is the host where the postgresql had been started*/
/*I entered the the absolute location of gemini and it doesn't functions
too.*/
but during the running of my java code I get these Errors:

java.lang.NullPointerException
java.lang.NullPointerException
        at
org.postgresql.util.PSQLException.translate(PSQLException.java, Compiled
Code)
        at org.postgresql.util.PSQLException.<init>(PSQLException.java,
Compiled Code)
        at org.postgresql.Driver.connect(Driver.java, Compiled Code)
        at java.sql.DriverManager.getConnection(DriverManager.java,
Compiled Code)
        at java.sql.DriverManager.getConnection(DriverManager.java,
Compiled Code)
        at TestDBConnection.<init>(TestDBConnection.java, Compiled Code)

        at TestDBConnection.main(TestDBConnection.java, Compiled Code)



The port (6666)was defined during the installation.

Can you tell me please where could be the probleme


Thank you for your help in advance

Elie Atallah


pgsql-bugs by date

Next:From: Jessica OrdDate: 2000-11-14 17:46:59
Subject: Fail to restore index tables by pg_dumpall
Previous:From: Vlyminckx FredericDate: 2000-11-14 14:56:17
Subject: libpq++ : constructor - destructor problem with PgConnection

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group