pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Jesus Maudes <jmaudes@ubu.es>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Why driver does not need to be registered?
Date: Wed, 25 Feb 2009 18:58:13 -0500 (EST)
Message-ID: <Pine.BSO.4.64.0902251853060.2899@leary.csoft.net> (raw)
In-Reply-To: <48cb7eaf0902251551w3fddb89bvd81bf0bada7cbc7@mail.gmail.com>
References: <48cb7eaf0902251551w3fddb89bvd81bf0bada7cbc7@mail.gmail.com>



On Thu, 26 Feb 2009, Jesus Maudes wrote:

> [Why does the driver show up even though I didn't register it?]
>

The JDBC4 spec included with the 1.6 JVM includes autoloading 
functionality by including a special file in the driver's jar file.

Section 9.2.1 of the JDBC4 spec says:

     The DriverManager.getConnection method has been enhanced to support
     the Java Standard Edition Service Provider mechanism. JDBC 4.0
     Drivers must include the file META-INF/services/java.sql.Driver.
     This file contains the name of the JDBC driver's implementation
     of java.sql.Driver.

So the JVM will scan the jars available and look for this special file and 
load the driver specified in it automatically.

Kris Jurka




view thread (2+ messages)

Message-ID: <Pine.BSO.4.64.0902251853060.2899@leary.csoft.net>
Permalink:  ../Pine.BSO.4.64.0902251853060.2899@leary.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.64.0902251853060.2899@leary.csoft.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: books@ejurka.com, jmaudes@ubu.es
  Subject: Re: Why driver does not need to be registered?
  In-Reply-To: <Pine.BSO.4.64.0902251853060.2899@leary.csoft.net>
  References: <48cb7eaf0902251551w3fddb89bvd81bf0bada7cbc7@mail.gmail.com> <Pine.BSO.4.64.0902251853060.2899@leary.csoft.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox