These factories accepts names as well as numerical identifiers. For example "NTF (Paris) /
France I" and "27581" both fetchs the same object. However, names may be ambiguous
since the same name may be used for more than one object. This is the case of "WGS 84" for
example. If such an ambiguity is found, an exception will be thrown. If names are not wanted as a
legal EPSG code, subclasses can override the isPrimaryKey(java.lang.String) method.

adaptSQL

Invoked when a new PreparedStatement is about to be created from a SQL string. Since
the EPSG database is available mainly in MS-Access format,
SQL statements are formatted using some syntax specific to this particular database software
(for example "SELECT * FROM [Coordinate Reference System]"). When prociding
subclass targeting another database vendor, then this method should be overridden in order to
adapt the local SQL syntax.

For example a subclass connecting to a PostgreSQL database could replace all
spaces (" ") between watching braces ("[" and "]") by underscore ("_").

Parameters:

statement - The statement in MS-Access syntax.

Returns:

The SQL statement to use. The default implementation returns the string unchanged.

isPrimaryKey

Returns true if the specified code may be a primary key in some table. This method do
not needs to checks any entry in the database. It should just checks from the syntax if the
code looks like a valid EPSG identifier. The default implementation returns true if
all non-space characters are digits.

When this method returns false, some createFoo(...) methods look for the
code in the name column instead of the primary key column. This allows to accept the
"NTF (Paris) / France I" string (for example) in addition to the "27581"
primary key. Both should fetch the same object.

If this method returns true in all cases, then this factory never search for
matching names. In such case, an appropriate exception will be thrown in createFoo(...) methods if the code is not found in the primary key column. Subclasses can
overrides this method that way if this is the intended behavior.

shutdown

Shutdown the database engine. This method is invoked twice by ThreadedEpsgFactory at
JVM shutdown: one time before the connection is closed, and a second time
after. This shutdown hook is useful for embedded database engine starting a
server process in addition to the client process. Just closing the connection is not enough
for them. Example:

HSQL database engine needs to execute a "SHUTDOWN" statement using the
connection before it is closed.

Derby database engine needs to instruct the driver
manager after all connections have been closed.

The default implementation does nothing, which is sufficient for implementations
connecting to a distant server (i.e. non-embedded database engine), for example MS-Access or PostgreSQL.

Parameters:

active - true if the connection is alive, or false
otherwise. This method is invoked first with active set to true, then a
second time with active set to false.