public class JdbcConnector extends AbstractConnector implements Connector
Modifier and Type | Field and Description |
---|---|
protected static int |
FETCH_SIZE |
DATE_LENGTH_UNRESTRICTED, projectId, schema
Constructor and Description |
---|
JdbcConnector() |
Modifier and Type | Method and Description |
---|---|
Connection |
connect() |
static JdbcConnector |
createConnector()
Creates a new JDBC connector
|
void |
dump(String file)
Dumps the source data CSV to a file
|
void |
extract(String dir)
Extracts the source data CSV to the database where it is going to be transformed
|
void |
extract(String file,
boolean transform)
Extract rows
|
int |
getFetchSize() |
String |
getJdbcPassword()
JDBC password getter
|
String |
getJdbcUrl()
JDBC url getter
|
String |
getJdbcUsername()
JDBC username getter
|
String |
getSqlQuery()
JDBC query getter
|
boolean |
processCommand(Command c,
CliParams cli,
ProcessingContext ctx)
Processes single command
|
static void |
saveConfigTemplate(String name,
String configFileName,
String jdbcUsr,
String jdbcPsw,
String jdbcDriver,
String jdbcUrl,
String query)
Saves a template of the config file
|
void |
setFetchSize(int fetchSize) |
void |
setJdbcPassword(String jdbcPassword)
JDBC password setter
|
void |
setJdbcUrl(String jdbcUrl)
JDBC url setter
|
void |
setJdbcUsername(String jdbcUsername)
JDBC username setter
|
void |
setSqlQuery(String sqlQuery)
JDBC query setter
|
checkLoadingStatus, copyAndTransform, deploy, dumpData, expandDates, extractAndTransfer, generateMaqlCreate, getProjectId, getResult, getSchema, initSchema, populateColumnsFromSchema, setIncremental, setProjectId, setProjectId, setSchema, transferData
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
deploy, extractAndTransfer, generateMaqlCreate, getSchema, setSchema
public static JdbcConnector createConnector()
public static void saveConfigTemplate(String name, String configFileName, String jdbcUsr, String jdbcPsw, String jdbcDriver, String jdbcUrl, String query) throws IOException, SQLException
name
- new schema nameconfigFileName
- config file namejdbcUsr
- JDBC usernamejdbcPsw
- JDBC passwordjdbcDriver
- JDBC driver class namejdbcUrl
- JDBC urlquery
- JDBC queryIOException
- if there is a problem with writing the config fileSQLException
- if there is a problem with the dbpublic void extract(String dir) throws IOException
extract
in interface Connector
extract
in class AbstractConnector
dir
- target directory where the data package will be storedIOException
- in case of IO issuespublic void dump(String file) throws IOException
dump
in interface Connector
dump
in class AbstractConnector
file
- target fileIOException
- in case of IO issuespublic void extract(String file, boolean transform) throws IOException
extract
in class AbstractConnector
file
- name of the target filetransform
- perform transformationsIOException
public Connection connect() throws SQLException
SQLException
public String getJdbcUsername()
public void setJdbcUsername(String jdbcUsername)
jdbcUsername
- JDBC usernamepublic String getJdbcPassword()
public void setJdbcPassword(String jdbcPassword)
jdbcPassword
- JDBC passwordpublic String getSqlQuery()
public void setSqlQuery(String sqlQuery)
sqlQuery
- JDBC querypublic String getJdbcUrl()
public void setJdbcUrl(String jdbcUrl)
jdbcUrl
- JDBC urlpublic int getFetchSize()
public void setFetchSize(int fetchSize)
public boolean processCommand(Command c, CliParams cli, ProcessingContext ctx) throws ProcessingException
processCommand
in interface Executor
processCommand
in class AbstractConnector
c
- command to be processedcli
- parameters (commandline params)ctx
- processing contextProcessingException
- in case of issues during the command processingCopyright © 2014. All rights reserved.