velosurf.sql
Class DriverInfo

java.lang.Object
  extended by velosurf.sql.DriverInfo

public class DriverInfo
extends java.lang.Object

Contains specific description and behaviour of jdbc drivers.

Main sources:

Author:
Claude Brisson

Field Summary
private  java.lang.String caseSensivity
          case-sensivity
private static java.util.Map<java.lang.String,DriverInfo> driverByClass
          map driver class -> driver infos.
private static java.util.Map<java.lang.String,DriverInfo> driverByVendor
          map jdbctag -> driver infos.
private  java.lang.String[] drivers
          list of driver classes
private  java.lang.String IDGenerationMethod
          ID generation method
private  java.util.regex.Pattern ignorePattern
          ignore tables matchoing this pattern
private  java.lang.String jdbcTag
          jdbc tag of the database vendor
private  java.lang.String lastInsertIDQuery
          query used to retrieve the last inserted id
private  java.lang.String name
          name of the database vendor
private  java.lang.String pingQuery
          ping SQL query
private  java.lang.String schemaQuery
          SQL query to set the current schema
 
Constructor Summary
private DriverInfo(java.lang.String name, java.lang.String jdbcTag, java.lang.String[] drivers, java.lang.String pingQuery, java.lang.String caseSensivity, java.lang.String schemaQuery, java.lang.String IDGenerationMethod, java.lang.String lastInsertIDQuery, java.lang.String ignorePattern)
          Driver info constructor.
 
Method Summary
static void addDriver(java.lang.String name, java.lang.String jdbcTag, java.lang.String[] drivers, java.lang.String pingQuery, java.lang.String caseSensivity, java.lang.String schemaQuery, java.lang.String IDGenerationMethod, java.lang.String lastInsertIDQuery, java.lang.String ignorePrefix)
          Add a new driver.
 java.lang.Object filterValue(java.lang.Object value)
          Driver-specofic value filtering
 java.lang.String getCaseSensivity()
          Get case sensivity default policy.
static DriverInfo getDriverInfo(java.lang.String url, java.lang.String driverClass)
          Get a driver info by url and driver class.
 java.lang.String[] getDrivers()
          Get the list of driver class names.
 java.lang.String getJdbcTag()
          Get the jdbc tag.
 long getLastInsertId(java.sql.Statement statement)
          Get the last inserted id.
 java.lang.String getPingQuery()
          Get the ping query.
 java.lang.String getSchemaQuery()
          Get the schema setter query.
 boolean ignoreTable(java.lang.String name)
          Check whether to ignore or not this table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

private java.lang.String name
name of the database vendor


jdbcTag

private java.lang.String jdbcTag
jdbc tag of the database vendor


drivers

private java.lang.String[] drivers
list of driver classes


pingQuery

private java.lang.String pingQuery
ping SQL query


caseSensivity

private java.lang.String caseSensivity
case-sensivity


schemaQuery

private java.lang.String schemaQuery
SQL query to set the current schema


IDGenerationMethod

private java.lang.String IDGenerationMethod
ID generation method


lastInsertIDQuery

private java.lang.String lastInsertIDQuery
query used to retrieve the last inserted id


ignorePattern

private java.util.regex.Pattern ignorePattern
ignore tables matchoing this pattern


driverByVendor

private static java.util.Map<java.lang.String,DriverInfo> driverByVendor
map jdbctag -> driver infos.


driverByClass

private static java.util.Map<java.lang.String,DriverInfo> driverByClass
map driver class -> driver infos.

Constructor Detail

DriverInfo

private DriverInfo(java.lang.String name,
                   java.lang.String jdbcTag,
                   java.lang.String[] drivers,
                   java.lang.String pingQuery,
                   java.lang.String caseSensivity,
                   java.lang.String schemaQuery,
                   java.lang.String IDGenerationMethod,
                   java.lang.String lastInsertIDQuery,
                   java.lang.String ignorePattern)
Driver info constructor.

Parameters:
name - name
jdbcTag - jdbc tag
drivers - array of driver class names
pingQuery - ping query (e.g. "select 1")
caseSensivity - default case sensivity policy
schemaQuery - query to change schema
IDGenerationMethod - preferred ID generation method
lastInsertIDQuery - query to get last inserted ID value
ignorePattern - ignore tables whose name matches this pattern
Method Detail

getDriverInfo

public static DriverInfo getDriverInfo(java.lang.String url,
                                       java.lang.String driverClass)
Get a driver info by url and driver class.

Parameters:
url - database url
driverClass - driver class
Returns:
driver infos

addDriver

public static void addDriver(java.lang.String name,
                             java.lang.String jdbcTag,
                             java.lang.String[] drivers,
                             java.lang.String pingQuery,
                             java.lang.String caseSensivity,
                             java.lang.String schemaQuery,
                             java.lang.String IDGenerationMethod,
                             java.lang.String lastInsertIDQuery,
                             java.lang.String ignorePrefix)
Add a new driver.

Parameters:
name - name
jdbcTag - jdbc tag
drivers - array of driver class names
pingQuery - ping query (e.g. "select 1")
caseSensivity - default case sensivity policy
schemaQuery - query to change schema
IDGenerationMethod - preferred ID generation method
lastInsertIDQuery - query to get last inserted ID value
ignorePrefix - ignore tables whose name matches this pattern

getJdbcTag

public java.lang.String getJdbcTag()
Get the jdbc tag.

Returns:
jdbc tag

getDrivers

public java.lang.String[] getDrivers()
Get the list of driver class names.

Returns:
array of driver class names

getPingQuery

public java.lang.String getPingQuery()
Get the ping query.

Returns:
ping query

getCaseSensivity

public java.lang.String getCaseSensivity()
Get case sensivity default policy.

Returns:
case sensivity default policy

getSchemaQuery

public java.lang.String getSchemaQuery()
Get the schema setter query.

Returns:
schema setter query

getLastInsertId

public long getLastInsertId(java.sql.Statement statement)
                     throws java.sql.SQLException
Get the last inserted id.

Parameters:
statement - source statement
Returns:
last inserted id (or -1)
Throws:
java.sql.SQLException

ignoreTable

public boolean ignoreTable(java.lang.String name)
Check whether to ignore or not this table.

Parameters:
name - table name
Returns:
whether to ignore this table

filterValue

public java.lang.Object filterValue(java.lang.Object value)
Driver-specofic value filtering

Parameters:
value - value to be filtered
Returns:
filtered value


~ooOoo~