com.continuent.tungsten.replicator.database
Interface Database

All Known Implementing Classes:
AbstractDatabase, DerbyDatabase, DrizzleDatabase, GreenplumDatabase, MySQLDatabase, MySQLDrizzleDatabase, OracleDatabase, PostgreSQLDatabase, VerticaDatabase

public interface Database

Defines the contract for a driver that implements database-specific SQL operations. There is an implementation of this interface for each DBMS implementation.

Version:
1.0
Author:
Scott Martin

Field Summary
static java.lang.String MYSQL
          String to denote MySQL DBMS dialect in metadata.
static java.lang.String ORACLE
          String to denote Oracle dialect in metadata.
static java.lang.String POSTGRESQL
          String to denote PostgreSQL dialect in metadata.
static java.lang.String UNKNOWN
          String to denote PostgreSQL dialect in metadata.
 
Method Summary
 void close()
          Closes the instance and frees all resources.
 void commit()
          Commit the current transaction.
 void connect()
          Connects to the database.
 void connect(boolean binlog)
          Connects to the database.
 void consistencyCheck(Table ct, ConsistencyCheck cc)
          Runs consistency check transaction
 void consistencyCheck(Table ct, ConsistencyCheck cc, java.lang.String masterCrc, int masterCnt)
          Runs consistency check transaction:
a.) If masterCrc==null - normal (master side) consistency check is executed, which is expected to be replicated to the slaves by replication.
b.) If masterCrc!=null, then masterCrc and masterCnt are put into corresponding columns, while executed check's results are put into this_crc and this_cnt columns.
 void controlSessionLevelLogging(boolean suppressed)
          Sets session-level logging of updates.
 void createSchema(java.lang.String schema)
          Creates the named schema.
 java.sql.Statement createStatement()
          Generate a JDBC statement.
 void createTable(Table table, boolean replace)
          Creates a table using the supplied table definition.
 void createTable(Table table, boolean replace, java.lang.String tungstenTableType)
          Creates a table using the supplied table definition and the provided table type.
 void createTable(Table table, boolean replace, java.lang.String tungstenSchema, java.lang.String tungstenTableType)
           
 void createTable(Table hbTable, boolean b, java.lang.String schema, java.lang.String tableType, java.lang.String serviceName)
           
 void createUser(User user)
          Creates a user.
 int delete(Table table, boolean allRows)
          Deletes a row in a table.
 void disconnect()
          Disconnects from the database.
 void dropSchema(java.lang.String schema)
          Drops the named schema.
 void dropTable(Table table)
          Drops an existing table.
 void dropTungstenCatalog(java.lang.String schemaName, java.lang.String tungstenTableType, java.lang.String serviceName)
          dropTungstenCatalog removes Tungsten catalog.
 void dropUser(User user, boolean ignore)
          Deletes a user.
 void execute(java.lang.String SQL)
          Executes a SQL request.
 void executeUpdate(java.lang.String SQL)
          Executes a SQL request containing an update.
 Table findTable(int tableID)
          Return the Table with all its current accompanying Columns that matches tableID.
 Table findTable(int tableID, java.lang.String scn)
          Return the Table with all its accompanying Columns at the provided scn that matches tableID.
 Table findTable(java.lang.String schemaName, java.lang.String tableName)
          Return the Table with all its accompanying Columns.
 byte[] getBlobAsBytes(java.sql.ResultSet resultSet, int column)
          Fetches the given column as a byte[] array.
 java.sql.ResultSet getColumnsResultSet(java.sql.DatabaseMetaData md, java.lang.String schemaName, java.lang.String tableName)
          Returns a result set containing columns for a specific table.
 java.sql.Connection getConnection()
          Returns the database connection
 java.lang.String getControlTimestampQuery(java.lang.Long timestamp)
          Returns a query that can be used to set the timestamp.
 CsvWriter getCsvWriter(java.io.BufferedWriter writer)
          Returns a properly configured CsvWriter to generate CSV according to the preferred conventions of this DBMS type.
 java.sql.DatabaseMetaData getDatabaseMetaData()
          Returns JDBC DatabaseMetadata for the current connection.
 java.lang.String getDatabaseObjectName(java.lang.String name)
          Returns the eventually quoted database object name.
 java.lang.String getNowFunction()
          getNowFunction returns the database-specific way to get current date and time from the database.
 java.lang.String getPlaceHolder(OneRowChange.ColumnSpec col, java.lang.Object colValue, java.lang.String typeDesc)
          Return a place holder in a prepared statement for a column of type ColumnSpec.
 java.util.ArrayList<java.lang.String> getReservedWords()
          Returns a list of reserved words used by the DBMS, which cannot be used as table and column names.
Words are expected to be upper case and applications checking with something similar to getReservedWords().contains(table.getName().toUpperCase()).
 java.util.ArrayList<java.lang.String> getSchemas()
          Returns a list of schemas available on the server.
 java.lang.String getSessionVariable(java.lang.String name)
          Get session variable.
 SqlOperationMatcher getSqlNameMatcher()
          Returns a SQL name matcher for this database type.
 java.util.ArrayList<Table> getTables(java.lang.String schema, boolean baseTablesOnly)
          Returns a list of tables available in the schema
 java.lang.String getTimeDiff(java.lang.String string1, java.lang.String string2)
          getTimeDiff returns the database-specific way of subtracting two "dates" and return the result in seconds complete with space for the two bind variables.
 DBMS getType()
          Returns the type of DBMS behind the interface
 java.lang.String getUseSchemaQuery(java.lang.String schema)
          Returns a query that can be used to set the schema.
 int insert(Table table)
          Inserts a row into a table.
 boolean isPrivileged()
          Returns true if this account is a super user.
 int javaSQLTypeToNativeType(int javaSQLType)
          Opposite of the above function.
 void kill(Session session)
          Kills a particular session.
 java.util.List<Session> listSessions()
          Lists user sessions in the DBMS server.
 int nativeTypeToJavaSQLType(int nativeType)
          Databases have various column types usually identified by some vendor defined integer value.
 boolean nullsBoundDifferently(OneRowChange.ColumnSpec col)
          Return TRUE IFF NULL values are bound differently in SQL statement from non null values for the given column type.
 boolean nullsEverBoundDifferently()
          return true IFF nulls are sometimes treated differently in nullsBoundDifferently() as non nulls.
 java.lang.String prepareOptionSetStatement(java.lang.String optionName, java.lang.String optionValue)
          prepareOptionSetStatement generates the sql statement that is to be used to set an option (or a session variable) at the database connection level.
 java.sql.PreparedStatement prepareStatement(java.lang.String statement)
          Generate a JDBC prepared statement.
 void replace(Table table)
          Replaces a row in the table using the data supplied by the Table specification.
 void rollback()
          Rollback the current transaction.
 void setAutoCommit(boolean autoCommit)
          Toggles autocommit by calling Connection.setAutocommit().
 void setPassword(java.lang.String password)
          Sets the database password.
 void setPrivileged(boolean privileged)
          Determines whether this connection has superuser privileges (e.g., SYSDBA or SUPER depending on the DBMS type).
 void setSessionVariable(java.lang.String name, java.lang.String value)
          Sets a session variable.
 void setUrl(java.lang.String url)
          Sets the JDBC URL used for database connections.
 void setUser(java.lang.String user)
          Sets the database user.
 boolean supportsControlSessionLevelLogging()
          Returns true if this implementation allow clients to turn logging of SQL updates on and off at the session level.
 boolean supportsControlTimestamp()
          Returns true if this implementation supports changing the timestamp value used by functions that return the current time.
 boolean supportsCreateDropSchema()
          Returns true if this implementation supports schema create and drop operations.
 boolean supportsNativeSlaveSync()
          Returns true if this implementation supports synchronization of native slave replication with Tungsten position.
 boolean supportsReplace()
          Returns true if the implementation supports a SQL REPLACE command.
 boolean supportsSessionVariables()
          Returns true if this implementation supports setting session variables.
 boolean supportsUseDefaultSchema()
          Returns true if this implementation supports changing the default schema, for example via a "USE " command.
 boolean supportsUserManagement()
          Returns true if this implementation supports user management commands.
 void syncNativeSlave(java.lang.String eventId)
          Synchronize the native slave position with Tungsten so that native replication can start properly after Tungsten goes offline.
 int update(Table table, java.util.ArrayList<Column> whereClause, java.util.ArrayList<Column> values)
          Updates on or more rows in a table.
 void useDefaultSchema(java.lang.String schema)
          Changes the default schema to the named schema.
 

Field Detail

MYSQL

static final java.lang.String MYSQL
String to denote MySQL DBMS dialect in metadata.

See Also:
Constant Field Values

ORACLE

static final java.lang.String ORACLE
String to denote Oracle dialect in metadata.

See Also:
Constant Field Values

POSTGRESQL

static final java.lang.String POSTGRESQL
String to denote PostgreSQL dialect in metadata.

See Also:
Constant Field Values

UNKNOWN

static final java.lang.String UNKNOWN
String to denote PostgreSQL dialect in metadata.

See Also:
Constant Field Values
Method Detail

getType

DBMS getType()
Returns the type of DBMS behind the interface


getSqlNameMatcher

SqlOperationMatcher getSqlNameMatcher()
                                      throws ReplicatorException
Returns a SQL name matcher for this database type. You can get a matcher without calling connect() first.

Throws:
ReplicatorException

setUrl

void setUrl(java.lang.String url)
Sets the JDBC URL used for database connections.


setUser

void setUser(java.lang.String user)
Sets the database user.


setPassword

void setPassword(java.lang.String password)
Sets the database password.


setPrivileged

void setPrivileged(boolean privileged)
Determines whether this connection has superuser privileges (e.g., SYSDBA or SUPER depending on the DBMS type). Superusers can create logins, kill sessions, and manipulate replication.

Parameters:
privileged - If true this account is a superuser

isPrivileged

boolean isPrivileged()
Returns true if this account is a super user.


connect

void connect()
             throws java.sql.SQLException
Connects to the database. You must set the url, user, and password then do this. Connection does not log queries by default.

Throws:
java.sql.SQLException

connect

void connect(boolean binlog)
             throws java.sql.SQLException
Connects to the database. You must set the url, user, and password then do this.

Parameters:
binlog - log connection updates.
Throws:
java.sql.SQLException

disconnect

void disconnect()
Disconnects from the database. This is also accomplished by close().


getDatabaseMetaData

java.sql.DatabaseMetaData getDatabaseMetaData()
                                              throws java.sql.SQLException
Returns JDBC DatabaseMetadata for the current connection.

Throws:
java.sql.SQLException

createTable

void createTable(Table table,
                 boolean replace)
                 throws java.sql.SQLException
Creates a table using the supplied table definition.

Parameters:
table - Table specification
replace - If true, replace an existing table
Throws:
java.sql.SQLException

supportsCreateDropSchema

boolean supportsCreateDropSchema()
                                 throws java.sql.SQLException
Returns true if this implementation supports schema create and drop operations.

Throws:
java.sql.SQLException

createSchema

void createSchema(java.lang.String schema)
                  throws java.sql.SQLException
Creates the named schema.

Throws:
java.sql.SQLException
See Also:
supportsCreateDropSchema()

dropSchema

void dropSchema(java.lang.String schema)
                throws java.sql.SQLException
Drops the named schema.

Throws:
java.sql.SQLException
See Also:
supportsCreateDropSchema()

supportsUseDefaultSchema

boolean supportsUseDefaultSchema()
                                 throws java.sql.SQLException
Returns true if this implementation supports changing the default schema, for example via a "USE " command.

Throws:
java.sql.SQLException

useDefaultSchema

void useDefaultSchema(java.lang.String schema)
                      throws java.sql.SQLException
Changes the default schema to the named schema.

Throws:
java.sql.SQLException
See Also:
supportsUseDefaultSchema()

getUseSchemaQuery

java.lang.String getUseSchemaQuery(java.lang.String schema)
Returns a query that can be used to set the schema.

See Also:
supportsUseDefaultSchema()

supportsControlSessionLevelLogging

boolean supportsControlSessionLevelLogging()
                                           throws java.sql.SQLException
Returns true if this implementation allow clients to turn logging of SQL updates on and off at the session level. (Currently only MySQL supports this feature.)

Throws:
java.sql.SQLException

controlSessionLevelLogging

void controlSessionLevelLogging(boolean suppressed)
                                throws java.sql.SQLException
Sets session-level logging of updates.

Parameters:
suppressed - If true, updates are not logged; otherwise logging is turned on
Throws:
java.sql.SQLException

supportsNativeSlaveSync

boolean supportsNativeSlaveSync()
Returns true if this implementation supports synchronization of native slave replication with Tungsten position. (Currently only MySQL supports this feature.)


syncNativeSlave

void syncNativeSlave(java.lang.String eventId)
                     throws java.sql.SQLException
Synchronize the native slave position with Tungsten so that native replication can start properly after Tungsten goes offline.

Parameters:
eventId - Tungsten event ID containing native log coordinates
Throws:
java.sql.SQLException

supportsControlTimestamp

boolean supportsControlTimestamp()
                                 throws java.sql.SQLException
Returns true if this implementation supports changing the timestamp value used by functions that return the current time.

Throws:
java.sql.SQLException

supportsSessionVariables

boolean supportsSessionVariables()
                                 throws java.sql.SQLException
Returns true if this implementation supports setting session variables.

Throws:
java.sql.SQLException

setSessionVariable

void setSessionVariable(java.lang.String name,
                        java.lang.String value)
                        throws java.sql.SQLException
Sets a session variable. This works only if the database type supports session variables.

Parameters:
name - Name of the variable to set
value - Value to set
Throws:
java.sql.SQLException - Thrown if setting variable is unsuccessful

getSessionVariable

java.lang.String getSessionVariable(java.lang.String name)
                                    throws java.sql.SQLException
Get session variable. This works only if the database type supports session variables.

Parameters:
name - Name of the variable to get
Returns:
Value of variable or null if unset
Throws:
java.sql.SQLException - Thrown if getting variable is unsuccessful

supportsUserManagement

boolean supportsUserManagement()
Returns true if this implementation supports user management commands.


createUser

void createUser(User user)
                throws java.sql.SQLException
Creates a user. Works only if the database type supports user management. This call is intended for testing.

Parameters:
user - User definition
Throws:
java.sql.SQLException

dropUser

void dropUser(User user,
              boolean ignore)
              throws java.sql.SQLException
Deletes a user. Works only if the database type supports user management. This call is intended for testing.

Parameters:
user - User definition
ignore - If true, ignore error
Throws:
java.sql.SQLException

listSessions

java.util.List<Session> listSessions()
                                     throws java.sql.SQLException
Lists user sessions in the DBMS server.

Throws:
java.sql.SQLException

kill

void kill(Session session)
          throws java.sql.SQLException,
                 ReplicatorException
Kills a particular session.

Throws:
java.sql.SQLException
ReplicatorException

findTable

Table findTable(int tableID)
                throws java.sql.SQLException
Return the Table with all its current accompanying Columns that matches tableID. tableID is meant to be some sort of unique "object number" interpreted within the current connection. The exact nature of of what this tableID will likely vary from rdbms to rdbms but in Oracle parlance it is an object number. Returns null if no such table exists.

Throws:
java.sql.SQLException

findTable

Table findTable(int tableID,
                java.lang.String scn)
                throws java.sql.SQLException
Return the Table with all its accompanying Columns at the provided scn that matches tableID. tableID is meant to be some sort of unique "object number" interpreted within the current connection. The exact nature of of what this tableID will likely vary from rdbms to rdbms but in Oracle parlance it is an object number. Returns null if no such table exists.

Parameters:
tableID - the object which is looked for
scn - when the object is search for
Returns:
a Table if matching was found
Throws:
java.sql.SQLException - if an error occurs

findTable

Table findTable(java.lang.String schemaName,
                java.lang.String tableName)
                throws java.sql.SQLException
Return the Table with all its accompanying Columns.

Parameters:
schemaName - name of schema containing the table
tableName - name of the table
Returns:
a Table if matching was found
Throws:
java.sql.SQLException - if an error occurs

getControlTimestampQuery

java.lang.String getControlTimestampQuery(java.lang.Long timestamp)
Returns a query that can be used to set the timestamp.

Parameters:
timestamp - A Java time value consisting of milliseconds since January 1, 1970 00:00:00 GMT
See Also:
supportsControlTimestamp()

execute

void execute(java.lang.String SQL)
             throws java.sql.SQLException
Executes a SQL request.

Throws:
java.sql.SQLException

executeUpdate

void executeUpdate(java.lang.String SQL)
                   throws java.sql.SQLException
Executes a SQL request containing an update.

Throws:
java.sql.SQLException

insert

int insert(Table table)
           throws java.sql.SQLException
Inserts a row into a table. Values are taken from the current Column instances stored in the table definition.

Parameters:
table - Table instance containing column data
Returns:
the number of inserted rows
Throws:
java.sql.SQLException

update

int update(Table table,
           java.util.ArrayList<Column> whereClause,
           java.util.ArrayList<Column> values)
           throws java.sql.SQLException
Updates on or more rows in a table.

Parameters:
table - Table instance to update
whereClause - List of columns containing where clause values, which are ANDed
values - List of columns containing values to set for matching rows
Returns:
the number of updated rows
Throws:
java.sql.SQLException

supportsReplace

boolean supportsReplace()
Returns true if the implementation supports a SQL REPLACE command.


replace

void replace(Table table)
             throws java.sql.SQLException
Replaces a row in the table using the data supplied by the Table specification. The Table instance's primary key is used to locate the matching row. This uses a REPLACE command if it is available.

Parameters:
table - Table definition with column data and primary key
Throws:
java.sql.SQLException
See Also:
supportsReplace()

delete

int delete(Table table,
           boolean allRows)
           throws java.sql.SQLException
Deletes a row in a table.

Parameters:
table - Table specification with primary key; columns for the key must be defined.
allRows - flag indicating that all rows from the underlying table should be deleted
Returns:
the number of deleted rows
Throws:
java.sql.SQLException

prepareStatement

java.sql.PreparedStatement prepareStatement(java.lang.String statement)
                                            throws java.sql.SQLException
Generate a JDBC prepared statement.

Parameters:
statement - SQL statement to prepare
Throws:
java.sql.SQLException

createStatement

java.sql.Statement createStatement()
                                   throws java.sql.SQLException
Generate a JDBC statement.

Throws:
java.sql.SQLException

commit

void commit()
            throws java.sql.SQLException
Commit the current transaction.

Throws:
java.sql.SQLException

rollback

void rollback()
              throws java.sql.SQLException
Rollback the current transaction.

Throws:
java.sql.SQLException

setAutoCommit

void setAutoCommit(boolean autoCommit)
                   throws java.sql.SQLException
Toggles autocommit by calling Connection.setAutocommit().

Throws:
java.sql.SQLException

getPlaceHolder

java.lang.String getPlaceHolder(OneRowChange.ColumnSpec col,
                                java.lang.Object colValue,
                                java.lang.String typeDesc)
Return a place holder in a prepared statement for a column of type ColumnSpec. Typically "?" as is INSERT INTO FOO VALUES(?)


nullsBoundDifferently

boolean nullsBoundDifferently(OneRowChange.ColumnSpec col)
Return TRUE IFF NULL values are bound differently in SQL statement from non null values for the given column type. For example, in Oracle, the datatype XML must look like "XMLTYPE(?)" in most SQL statements, but in the case of a NULL value, it would look simply like "?".


nullsEverBoundDifferently

boolean nullsEverBoundDifferently()
return true IFF nulls are sometimes treated differently in nullsBoundDifferently() as non nulls.


getConnection

java.sql.Connection getConnection()
Returns the database connection


dropTable

void dropTable(Table table)
Drops an existing table.


close

void close()
Closes the instance and frees all resources.


nativeTypeToJavaSQLType

int nativeTypeToJavaSQLType(int nativeType)
                            throws java.sql.SQLException
Databases have various column types usually identified by some vendor defined integer value. e.g. 2 = Oracle number, 12 = Oracle date. This function converts the vendor specific type numbers into the java.sql.Type numbers we shall use internally.

Throws:
java.sql.SQLException

javaSQLTypeToNativeType

int javaSQLTypeToNativeType(int javaSQLType)
                            throws java.sql.SQLException
Opposite of the above function. I cannot image why any of the portable code should ever need to call this function. But it seems like a fine place to create a place holder for such a function declaration even if only called from vendor specific code.

Throws:
java.sql.SQLException

getSchemas

java.util.ArrayList<java.lang.String> getSchemas()
                                                 throws java.sql.SQLException
Returns a list of schemas available on the server.

Returns:
list of available schemas
Throws:
java.sql.SQLException

getTables

java.util.ArrayList<Table> getTables(java.lang.String schema,
                                     boolean baseTablesOnly)
                                     throws java.sql.SQLException
Returns a list of tables available in the schema

Parameters:
schema - Name of the schema
baseTablesOnly - If true, only return real tables and not catalogs or views
Returns:
list of tables in the schema
Throws:
java.sql.SQLException

getColumnsResultSet

java.sql.ResultSet getColumnsResultSet(java.sql.DatabaseMetaData md,
                                       java.lang.String schemaName,
                                       java.lang.String tableName)
                                       throws java.sql.SQLException
Returns a result set containing columns for a specific table.

Parameters:
md - DatabaseMetaData object
schemaName - schema name
tableName - table name
Returns:
ResultSet as produced by DatabaseMetaData.getColumns() for a given schema and table
Throws:
java.sql.SQLException

consistencyCheck

void consistencyCheck(Table ct,
                      ConsistencyCheck cc)
                      throws java.sql.SQLException,
                             ConsistencyException
Runs consistency check transaction

Parameters:
ct - consitency table
cc - ConsistencyCheck specification
Throws:
java.sql.SQLException
ConsistencyException

consistencyCheck

void consistencyCheck(Table ct,
                      ConsistencyCheck cc,
                      java.lang.String masterCrc,
                      int masterCnt)
                      throws java.sql.SQLException,
                             ConsistencyException
Runs consistency check transaction:
a.) If masterCrc==null - normal (master side) consistency check is executed, which is expected to be replicated to the slaves by replication.
b.) If masterCrc!=null, then masterCrc and masterCnt are put into corresponding columns, while executed check's results are put into this_crc and this_cnt columns. The idea behind this is that if there's no replication running, that would usually copy over the consistency check from master to slave, it inserts consistency check results of the master to this slave, runs consistency check on this slave and updates the slave part (this_crc and this_cnt) in the created consistency row accordingly.

Parameters:
ct - Consistency table.
cc - ConsistencyCheck specification.
masterCrc - CRC value of this check on the master.
masterCnt - Count of rows of this check on the master.
Throws:
java.sql.SQLException
ConsistencyException

getNowFunction

java.lang.String getNowFunction()
getNowFunction returns the database-specific way to get current date and time from the database.

Returns:
the name of the function to be called at the database level to get the current date and time

getTimeDiff

java.lang.String getTimeDiff(java.lang.String string1,
                             java.lang.String string2)
getTimeDiff returns the database-specific way of subtracting two "dates" and return the result in seconds complete with space for the two bind variables. E.g. in MySQL it might be "time_to_sec(timediff(?, ?))". If either of the string variables are null, replace with the bind character (e.g. "?") else use the string given. For example getTimeDiff(null, "myTimeCol") -> time_to_sec(timediff(?, myTimeCol))


createTable

void createTable(Table table,
                 boolean replace,
                 java.lang.String tungstenTableType)
                 throws java.sql.SQLException
Creates a table using the supplied table definition and the provided table type.

Parameters:
table - Table specification
replace - If true, replace an existing table
tungstenTableType - table type to be used for tungsten catalog tables
Throws:
java.sql.SQLException

createTable

void createTable(Table table,
                 boolean replace,
                 java.lang.String tungstenSchema,
                 java.lang.String tungstenTableType)
                 throws java.sql.SQLException
Throws:
java.sql.SQLException

createTable

void createTable(Table hbTable,
                 boolean b,
                 java.lang.String schema,
                 java.lang.String tableType,
                 java.lang.String serviceName)
                 throws java.sql.SQLException
Throws:
java.sql.SQLException

prepareOptionSetStatement

java.lang.String prepareOptionSetStatement(java.lang.String optionName,
                                           java.lang.String optionValue)
prepareOptionSetStatement generates the sql statement that is to be used to set an option (or a session variable) at the database connection level.

Parameters:
optionName - the option to be set
optionValue - the value to be used
Returns:
a string that contains the statement that should be executed, or null if this does not exist for a database

getBlobAsBytes

byte[] getBlobAsBytes(java.sql.ResultSet resultSet,
                      int column)
                      throws java.sql.SQLException
Fetches the given column as a byte[] array. For MySQL and Oracle this means converting BLOB field into byte[] array, while for PostgreSQL - returning the bytea type field's value.

Parameters:
resultSet - ResultSet which has this blob column.
column - Index of the column to fetch value from.
Returns:
byte[] array containing underlying BLOB or bytea field value.
Throws:
java.sql.SQLException - As this method is operating on ResultSet, it might throw a SQLException.

getDatabaseObjectName

java.lang.String getDatabaseObjectName(java.lang.String name)
Returns the eventually quoted database object name. For example, with mysql, database object names should be backticked (`example`).

Parameters:
name - unquoted database object name
Returns:
eventually quoted database object name

getCsvWriter

CsvWriter getCsvWriter(java.io.BufferedWriter writer)
Returns a properly configured CsvWriter to generate CSV according to the preferred conventions of this DBMS type.

Parameters:
writer - A buffered writer to receive CSV output
Returns:
A property configured CsvWriter instance

getReservedWords

java.util.ArrayList<java.lang.String> getReservedWords()
Returns a list of reserved words used by the DBMS, which cannot be used as table and column names.
Words are expected to be upper case and applications checking with something similar to getReservedWords().contains(table.getName().toUpperCase()).

Returns:
A list of reserved words.

dropTungstenCatalog

void dropTungstenCatalog(java.lang.String schemaName,
                         java.lang.String tungstenTableType,
                         java.lang.String serviceName)
                         throws java.sql.SQLException
dropTungstenCatalog removes Tungsten catalog.

Parameters:
schemaName - The schema name where Tungsten catalog is stored
tungstenTableType - The type of table used to store Tungsten metadata
serviceName - The service name for which the catalog has to be dropped
Throws:
java.sql.SQLException - when an error occurs