org.geotools.gce.imagemosaic.jdbc
Class DBDialect

java.lang.Object
  extended by org.geotools.gce.imagemosaic.jdbc.DBDialect
Direct Known Subclasses:
DB2Dialect, MySqlDialect, OracleDialect, PostgisDialect, UniversalDialect

public abstract class DBDialect
extends java.lang.Object

This class is the base class for the different sql dialects used in spatial extensions form different vendors

Since:
2.5
Author:
mcr

Field Summary
protected  Config config
           
protected  javax.sql.DataSource dataSource
           
 
Constructor Summary
DBDialect(Config config)
          Constructor
 
Method Summary
protected abstract  java.lang.String getBLOBSQLType()
           
protected  Config getConfig()
           
 java.sql.Connection getConnection()
           
protected abstract  java.lang.String getCreateIndexStatement(java.lang.String tn)
           
protected  java.lang.String getCreateSpatialTableStatement(java.lang.String tableName)
           
protected  java.lang.String getCreateSpatialTableStatementJoined(java.lang.String tableName)
           
static DBDialect getDBDialect(Config config)
          Factory method for obtaining a DBDialect object for a special spatial extension
protected  java.lang.String getDoubleSQLType()
           
protected abstract  java.lang.String getMultiPolygonSQLType()
           
protected  java.lang.String getRegisterSpatialStatement(java.lang.String tn, java.lang.String srs)
           
protected  java.lang.String getUnregisterSpatialStatement(java.lang.String tn)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dataSource

protected javax.sql.DataSource dataSource

config

protected Config config
Constructor Detail

DBDialect

public DBDialect(Config config)
Constructor

Parameters:
config -
Method Detail

getDBDialect

public static DBDialect getDBDialect(Config config)
Factory method for obtaining a DBDialect object for a special spatial extension

Parameters:
config -
Returns:

getBLOBSQLType

protected abstract java.lang.String getBLOBSQLType()
Returns:
the sql type name for a blob (Binary Large Object)

getMultiPolygonSQLType

protected abstract java.lang.String getMultiPolygonSQLType()
Returns:
the sql type name for a Multipolygon

getConfig

protected Config getConfig()
Returns:
the config object for this dialect

getConnection

public java.sql.Connection getConnection()
                                  throws java.lang.Exception
Returns:
jdbc connection
Throws:
java.lang.Exception

getUnregisterSpatialStatement

protected java.lang.String getUnregisterSpatialStatement(java.lang.String tn)
Parameters:
tn - sql table name
Returns:
sql unregister spatial column statement for nt

getRegisterSpatialStatement

protected java.lang.String getRegisterSpatialStatement(java.lang.String tn,
                                                       java.lang.String srs)
Parameters:
tn - sql table name
srs - name of spatial reference system to use
Returns:
sql unregister spatial column statement for nt

getCreateIndexStatement

protected abstract java.lang.String getCreateIndexStatement(java.lang.String tn)
                                                     throws java.lang.Exception
Parameters:
tn - sql table name
Returns:
sql create spatial index statement for tn
Throws:
java.lang.Exception

getDoubleSQLType

protected java.lang.String getDoubleSQLType()
Returns:
sql datatype for 8 byte floating point

getCreateSpatialTableStatement

protected java.lang.String getCreateSpatialTableStatement(java.lang.String tableName)
                                                   throws java.lang.Exception
Parameters:
tableName -
Returns:
the sql create table statement for a spatial table
Throws:
java.lang.Exception

getCreateSpatialTableStatementJoined

protected java.lang.String getCreateSpatialTableStatementJoined(java.lang.String tableName)
                                                         throws java.lang.Exception
Parameters:
tableName -
Returns:
the sql create table statement for a combined spatial/tile table named tableName
Throws:
java.lang.Exception


Copyright © 1996-2010 Geotools. All Rights Reserved.