Subject: JDBC documentation - issue report

From: Christopher Barham <[email-masked]>
Date: Mon, 18 Aug 2014 13:18:35 +0000

Hi,

Just spotted a possible issue in the Documentation around loading the JDBC driver.  This page documents how: http://jdbc.postgresql.org/documentation/93/load.html
However, as of JDK6/JDBC 4.0, it should not be necessary to use the
Class.forName("org.postgresql.Driver");
method to load the JDBC driver as they are automatically loaded  - see Javadoc here
http://docs.oracle.com/javase/8/docs/api/java/sql/DriverManager.html

Cheers,
Chris

---

From: Josh Berkus <[email-masked]>
Date: Mon, 18 Aug 2014 10:12:49 -0700

Forwarding this to pgsql-jdbc mailing list.

On 08/18/2014 06:18 AM, Christopher Barham wrote:
> Hi,
> 
>  
> 
> Just spotted a possible issue in the Documentation around loading the
> JDBC driver.  This page documents how:
> http://jdbc.postgresql.org/documentation/93/load.html
> 
> method to load the JDBC driver as they are automatically loaded  – see
> Javadoc here
> 

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

-- 
Sent via pgsql-jdbc mailing list ([email-masked])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc

---

From: Craig Ringer <[email-masked]>
Date: Wed, 20 Aug 2014 12:27:40 +0800

>> http://docs.oracle.com/javase/8/docs/api/java/sql/DriverManager.html

That's valid, but minor, really; the Class.forName(...) call is harmless.

Given how badly confused users seem to be about JDBC3 vs JDBC4 etc, I'm
reluctant to remove this until Java SE 5 is dead and gone and PgJDBC
drops JDBC4 support. Sometime around 2030 at the rate adoption of newer
releases is going.

A note to say that explicit loading is ineffective if using a JDBC4
driver and on Java 1.6 or newer would be reasonable.

-- 
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

-- 
Sent via pgsql-docs mailing list ([email-masked])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs

---

From: Dave Cramer <[email-masked]>
Date: Wed, 20 Aug 2014 07:57:56 -0400

Ya, this really is an innocuous issue

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca