The driver told me to do it.

From: erik(dot)berglund(at)eyeone(dot)no
To: pgsql-bugs(at)postgresql(dot)org
Subject: The driver told me to do it.
Date: 2001-02-25 21:06:16
Message-ID: 3A9981D8.4943.665DCD6C@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi.
As per the instructions in the exception message, I report this bug.
However, this my first encounter with JDBC, so I'm pretty sure this
is because of some newbie mistake on my part. If indeed this is
the case, please feel free to enlighten me.

The postgresql jdbc driver gave me this error message:
<snip>
[erik(at)thunderdome server]$ ./start
JDBC driver loaded.
Failed database load:
Something unusual has occured to cause the driver to fail. Please
report this exception: java.lang.NullPointerException:
at org.postgresql.Driver.connect(Driver.java:125)
at
java.sql.DriverManager.getConnection(DriverManager.java:453)
at
java.sql.DriverManager.getConnection(DriverManager.java:133)
at eyeone.net.server.Server.<init>(Server.java:98)
at eyeone.net.server.Server.main(Server.java:232)
EyeOne generic game server version 2.0.1 listening on port 3456
<snip>

So her is the report:
The postgresql data base is version 7.0.3
The jdbc driver is "jdbc7.0-1.2.jar" downloaded from
jdbc.postgresql.org.

The application in question is running on:
<snip>
java version "1.2.2"
Classic VM (build 1.2.2_006, green threads, nojit)
<snip>

Started with this command:
<snip>
java -cp .:./postgresql.jar -Djava.library.path=.
eyeone/net/server/Server 3456 $1
</snip>

And the code throwing the exception looks like this:
<snip>
//try to init the database
if((this.DBUSERNAME == null) || (this.DATABASE == null) ||
(this.DBPASSWORD==null))
{
//skip database initing
}
else
{
try
{
Class c = Class.forName("org.postgresql.Driver");
System.err.println("JDBC driver loaded.");
if(c == null)
{
System.err.println("Or is it?");
}
java.sql.Connection db =
DriverManager.getConnection("127.0.0.1", this.DBUSERNAME,
this.DBPASSWORD);
if(db != null)
{
System.err.println("Connected to database.");
}
else
{
System.err.println("No connection available.");
}
}
catch(Exception e)
{
System.err.println("Failed database load:");
e.printStackTrace();
}
}
</snip>
(If you wish, I'll gladly send You the entire .java file.)

Regards,
Erik Berglund
game programmer
www.eyeone.com

Browse pgsql-bugs by date

  From Date Subject
Next Message Dmitry G . Mastrukov 2001-02-26 10:20:13 postgresql-7.1beta5 configure
Previous Message Tom Lane 2001-02-25 18:00:38 Re: psql crashes postmaster