com.googlecode.jdbw.server
Class AbstractDatabaseType

java.lang.Object
  extended by com.googlecode.jdbw.server.AbstractDatabaseType
All Implemented Interfaces:
DatabaseServerType
Direct Known Subclasses:
H2ServerTypes.H2ServerType, MySQLServerType, PostgresqlServerType, SybaseASEServerType

public abstract class AbstractDatabaseType
extends Object
implements DatabaseServerType

Includes some fundamental checks for connection errors and default implementations for some JDBW objects

Author:
Martin Berglund

Constructor Summary
AbstractDatabaseType()
           
 
Method Summary
 AutoExecutor createAutoExecutor(DataSource dataSource)
          Creates an AutoExecutor for this server type
 SQLExecutor createExecutor(Connection connection)
          Creates an SQLExecutor for this server type
 MetaDataResolver createMetaDataResolver(DataSource dataSource)
          Creates a MetaDataResolver for this server type
 SQLDialect getSQLDialect()
           
 boolean isConnectionError(SQLException e)
          Check an SQLException with this server type if it is considered a connection error
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.googlecode.jdbw.DatabaseServerType
getName
 

Constructor Detail

AbstractDatabaseType

public AbstractDatabaseType()
Method Detail

getSQLDialect

public SQLDialect getSQLDialect()
Specified by:
getSQLDialect in interface DatabaseServerType
Returns:
SQLDialect for the server type

createAutoExecutor

public AutoExecutor createAutoExecutor(DataSource dataSource)
Description copied from interface: DatabaseServerType
Creates an AutoExecutor for this server type

Specified by:
createAutoExecutor in interface DatabaseServerType
Parameters:
dataSource - DataSource that is backing the auto executor
Returns:
AutoExecutor-implementation for this server type

createExecutor

public SQLExecutor createExecutor(Connection connection)
Description copied from interface: DatabaseServerType
Creates an SQLExecutor for this server type

Specified by:
createExecutor in interface DatabaseServerType
Parameters:
connection - Connection to be used by the SQLExecutor
Returns:
SQLExecutor-implementation for this server type

createMetaDataResolver

public MetaDataResolver createMetaDataResolver(DataSource dataSource)
Description copied from interface: DatabaseServerType
Creates a MetaDataResolver for this server type

Specified by:
createMetaDataResolver in interface DatabaseServerType
Parameters:
dataSource - DataSource to be used by this MetaDataResolver
Returns:
MetaDataResolver-implementation for this server type

isConnectionError

public boolean isConnectionError(SQLException e)
Description copied from interface: DatabaseServerType
Check an SQLException with this server type if it is considered a connection error

Specified by:
isConnectionError in interface DatabaseServerType
Parameters:
e - SQLException to check
Returns:
true if the SQLException is caused by connection problems, false otherwise


Copyright © 2012. All Rights Reserved.