Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

Re: Why driver does not need to be registered?


  • From: Kris Jurka <books(at)ejurka(dot)com>
  • To: Jesus Maudes <jmaudes(at)ubu(dot)es>
  • Cc: pgsql-jdbc(at)postgresql(dot)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> <text/plain>



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




Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group