Re: bug - connection problem with jdk 1.7 ?

From: dmp <danap(at)ttc-cmc(dot)net>
To: PostgreSQL JDBC <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: bug - connection problem with jdk 1.7 ?
Date: 2014-03-27 17:03:50
Message-ID: 533459F6.8080509@ttc-cmc.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

> (I send this e-mail again, because I hadn't subscribed me to the mailing list)
>
> Hello,
>
> I already presented on the devshed forum a connection problem to postgresql with the jdbc jar file postgresql-9.3-1100.jdbc41.jar. Nobody answered me.
>
> Until recently I thought that the origin of the problem was maybe Eclipse, but now I have tested the same code with a recent version of another development tool, Intellij IDEA, and the problem is still the same.
>
> That’s why I begin to think that the postgresql-9.3-1100.jdbc41.jar file doesn’t function correctly with the jdk 1.7 (version 51.0), moreover because the same code worked very well with jdk 1.6, postgresql 9.0 and postgresql-9.0-801.jdbc4.jar.
>
> So, now I repeat the explanation of the jdbc connection problem that I gave on the devshed forum:
>
> Recently I bought a new computer and installed a running project with upgraded versions of windows (windows 7, 64 bit), eclipse (4.3.1), java (jdk 1.7 : 51.0), postgresql (9.3) and jdbc (postgresql-9.3-1100.jdbc41.jar).
>
> On the older versions the programs ran without any problem, but now there is an exception in the following code:
>
> public static final String DBURL = "jdbc:postgresql:MR";
> public static final String DBUSER = "postgres";
>
> . . .
>
> public static Connection createConnection () throws SQLException {
> Properties props = new Properties();
> props.setProperty("user",DBUSER);
> return DriverManager.getConnection(DBURL, props);
> }

dbConnection = DriverManager.getConnection(connectionURLString, connectProperties);

Connection URL: jdbc:postgresql://127.0.0.1:5432/key_tables

What is "jdbc:postgresql:MR"? Is this a valid URL string?

Above works fine with eclipse, jdk 1.7_45, 9.3-1101.jdbc41.jar

Test of your URL:

Connection Parameters: jdbc:postgresql:key_tables?user=danap&password=&loglevel=0
ClassNotFoundExceptionjava.lang.ClassNotFoundException: org.postgresql.Driver
SQLExeceptionjava.sql.SQLException: No suitable driver found for
jdbc:postgresql:key_tables?user=danap&password=&loglevel=0

Which would result in NULL being returned as you have indicated.

danap.

>
> . . .
>
> ~
> ~
> ~
>
> Tim

Browse pgsql-jdbc by date

  From Date Subject
Next Message Edson Richter 2014-03-27 17:45:25 Re: Slow performance with 9.3-110x JDBC 4
Previous Message Lachezar Dobrev 2014-03-27 16:58:23 Re: Slow performance with 9.3-110x JDBC 4