Jdbc driver connection error - Mailing list pgsql-interfaces

From Ashish Sharma
Subject Jdbc driver connection error
Date
Msg-id 005d01bf2b04$1bc93d20$9800a8c0@toasia.co.jp
Whole thread Raw
List pgsql-interfaces
It's kinda urgent, if u cud help !!
 
Well, I compiled postgresql.jar, included it in CLASSPATH, and then ran the example.
(RedHat Linux6.0, postgreSQL6.5.2 on Intel Celeron)
 
Here's what I did, and what I get:
 
-----------
[postgres@linux jdbc]$ java example.basic jdbc:postgresql:template1 postgres postgres      
PostgreSQL basic test v6.3 rev 1
 
Connecting to Database URL = jdbc:postgresql:template1
Exception caught.
java.lang.IllegalArgumentException: Argument # > Arg length
java.lang.IllegalArgumentException: Argument # > Arg length
 at java.text.MessageFormat.format(MessageFormat.java)
 at java.text.MessageFormat.format(MessageFormat.java)
 at java.text.MessageFormat.format(MessageFormat.java)
 at postgresql.util.PSQLException.translate(PSQLException.java:83)
 at postgresql.util.PSQLException.<init>(PSQLException.java:45)
 at postgresql.Driver.connect(Driver.java:108)
 at java.sql.DriverManager.getConnection(DriverManager.java:83)
 at java.sql.DriverManager.getConnection(DriverManager.java:126)
 at example.basic.<init>(basic.java:32)
 at example.basic.main(basic.java:171)
[postgres@linux jdbc]$
 
-----------
And then I ran it using Debug option:
-----------
 
[postgres@linux jdbc]$ java example.basic jdbc:postgresql:template1 postgres postgres debug
PostgreSQL basic test v6.3 rev 1
 
DriverManager.initialize: jdbc.drivers = null
JDBC DriverManager initialized
registerDriver: driver[className=postgresql.Driver,context=null,postgresql.Driver@80aadf8]
Connecting to Database URL = jdbc:postgresql:template1
DriverManager.getConnection("jdbc:postgresql:template1")
    trying driver[className=postgresql.Driver,context=null,postgresql.Driver@80aadf8]
-- listing properties --
password=postgres
Protocol=postgresql
user=postgres
PGDBNAME=template1
Using postgresql.jdbc1.Connection
Exception caught.
java.lang.NullPointerException:
java.lang.NullPointerException:
 at java.io.Writer.write(Writer.java)
 at java.io.PrintStream.write(PrintStream.java)
 at java.io.PrintStream.print(PrintStream.java)
 at java.io.PrintStream.println(PrintStream.java)
 at java.lang.Throwable.printStackTrace(Throwable.java)
 at java.sql.SQLException.<init>(SQLException.java:102)
 at postgresql.util.PSQLException.<init>(PSQLException.java:42)
 at postgresql.Driver.connect(Driver.java:108)
 at java.sql.DriverManager.getConnection(DriverManager.java:83)
 at java.sql.DriverManager.getConnection(DriverManager.java:126)
 at example.basic.<init>(basic.java:32)
 at example.basic.main(basic.java:171)
[postgres@linux jdbc]$
 
-----------
 
What's that I am missing??
 
Thanx a lot.
 
-Ashish
 

pgsql-interfaces by date:

Previous
From: "Ashish Sharma"
Date:
Subject: Jdbc driver connection error
Next
From: Thomas Lockhart
Date:
Subject: Re: [HACKERS] CORBA STATUS