public abstract class SqlManager extends ConnManager
| Modifier and Type | Field and Description |
|---|---|
protected static int |
DEFAULT_FETCH_SIZE |
static org.apache.commons.logging.Log |
LOG |
| Constructor and Description |
|---|
SqlManager()
Constructs the SqlManager.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Perform any shutdown operations on the connection.
|
protected ResultSet |
execute(String stmt,
Integer fetchSize,
Object... args)
Executes an arbitrary SQL statement.
|
protected ResultSet |
execute(String stmt,
Object... args) |
protected String |
getColNamesQuery(String tableName) |
protected String |
getColTypesQuery(String tableName) |
String[] |
getColumnDataForRawQuery(String stmt)
Get column names for a query statement that we do not modify further.
|
Map<String,DatabaseMetaData.Column> |
getColumnTypeNamesForQuery(String query)
Return an unordered mapping from colname to sql type name for all columns
in a query.
|
protected Map<String,DatabaseMetaData.Column> |
getColumnTypeNamesForRawQuery(String stmt) |
Map<String,DatabaseMetaData.Column> |
getColumnTypeNamesForTable(String tableName)
Return an unordered mapping from colname to sql type name for all columns
in a table.
|
abstract Connection |
getConnection()
Retrieve the actual connection from the outer ConnManager.
|
protected abstract String |
getConnectionString() |
protected int |
getMetadataIsolationLevel() |
protected abstract String |
getPassword() |
String[] |
getPrimaryKeyColDetails(String stmt) |
String[] |
getPrimaryKeyColumnNames(String tableName) |
protected abstract String |
getPrimaryKeyQuery(String tableName) |
protected abstract String |
getUserName() |
protected Connection |
makeConnection()
Create a connection to the database; usually used only from within
getConnection(), which enforces a singleton guarantee around the
Connection object.
|
void |
release()
If a method of this ConnManager has returned a ResultSet to you, you are
responsible for calling release() after you close the ResultSet object,
to free internal resources.
|
escapeTableName, getColumnTypeNames, getColumnTypesForQuery, getDriverClass, timestampToQueryStringpublic static final org.apache.commons.logging.Log LOG
protected static final int DEFAULT_FETCH_SIZE
public SqlManager()
opts - the SqoopOptions describing the user's requested action.protected String getColNamesQuery(String tableName)
public String[] getColumnDataForRawQuery(String stmt) throws SQLException
SQLExceptionprotected String getColTypesQuery(String tableName)
public Map<String,DatabaseMetaData.Column> getColumnTypeNamesForTable(String tableName)
ConnManagergetColumnTypeNamesForTable in class ConnManagerpublic Map<String,DatabaseMetaData.Column> getColumnTypeNamesForQuery(String query)
ConnManagergetColumnTypeNamesForQuery in class ConnManagerprotected Map<String,DatabaseMetaData.Column> getColumnTypeNamesForRawQuery(String stmt)
protected ResultSet execute(String stmt, Object... args) throws SQLException
SQLExceptionpublic abstract Connection getConnection() throws SQLException
getConnection in class ConnManagerSQLExceptionprotected Connection makeConnection() throws SQLException
SQLExceptionprotected abstract String getConnectionString()
protected abstract String getPassword()
protected abstract String getUserName()
protected ResultSet execute(String stmt, Integer fetchSize, Object... args) throws SQLException
stmt - The SQL statement to executefetchSize - Overrides default or parameterized fetch sizeSQLExceptionpublic void close()
throws SQLException
ConnManagerclose in class ConnManagerSQLExceptionprotected int getMetadataIsolationLevel()
public void release()
ConnManagerrelease in class ConnManagerCopyright © 2015 Actian Corporation. All Rights Reserved.