org.geotools.referencing.factory.epsg
Class AccessDataSource

java.lang.Object
  extended bysun.jdbc.odbc.ee.CommonDataSource
      extended bysun.jdbc.odbc.ee.DataSource
          extended byorg.geotools.referencing.factory.epsg.AccessDataSource
All Implemented Interfaces:
DataSource, javax.sql.DataSource, javax.naming.Referenceable, java.io.Serializable

public class AccessDataSource
extends sun.jdbc.odbc.ee.DataSource
implements DataSource

Connection to the EPSG database in MS-Access format using JDBC-ODBC bridge. The EPSG database can be downloaded from http://www.epsg.org. The JDBC-ODBC bridge is a documented feature of Sun's J2SE distribution. See New data source implementations in the JDBC-ODBC bridge.

Just having this class accessible in the classpath, together with the registration in the directory, is suffisient to get a working EPSG authority factory backed by this database. Vendors can create a copy of this class, modify it and bundle it with their own distribution if they want to connect their users to an other database (for example a PostgreSQL database reachable on internet).

Since:
2.1
Version:
$Id: AccessDataSource.java 17661 2006-01-18 07:55:11Z desruisseaux $
Author:
Martin Desruisseaux
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.geotools.referencing.factory.epsg.DataSource
MAXIMUM_PRIORITY, MINIMUM_PRIORITY, NORMAL_PRIORITY
 
Constructor Summary
AccessDataSource()
          Creates a new instance of this data source
 
Method Summary
 AbstractAuthorityFactory createFactory(Hints hints)
          Open a connection and creates an EPSG factory for it.
 int getPriority()
          Returns the priority for this data source.
 
Methods inherited from class sun.jdbc.odbc.ee.DataSource
getConnection, getConnection, getReference
 
Methods inherited from class sun.jdbc.odbc.ee.CommonDataSource
getAttributes, getCharSet, getDatabaseName, getDataSourceName, getDescription, getLoginTimeout, getLogWriter, getPassword, getPortNumber, getRoleName, getTracer, getUser, setCharSet, setDatabaseName, setDataSourceName, setDescription, setLoginTimeout, setLogWriter, setPassword, setPortNumber, setRoleName, setUser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.sql.DataSource
getConnection, getConnection, getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter
 

Constructor Detail

AccessDataSource

public AccessDataSource()
Creates a new instance of this data source

Method Detail

getPriority

public int getPriority()
Returns the priority for this data source. The default implementation returns NORMAL_PRIORITY - 10.

Specified by:
getPriority in interface DataSource

createFactory

public AbstractAuthorityFactory createFactory(Hints hints)
                                       throws java.sql.SQLException
Open a connection and creates an EPSG factory for it.

Specified by:
createFactory in interface DataSource
Parameters:
hints - A map of hints, including the low-level factories to use for CRS creation.
Returns:
The EPSG factory using MS-Access SQL syntax.
Throws:
java.sql.SQLException - if connection to the database failed.


Copyright © GeoTools. All Rights Reserved.