Class MySQLDriver
java.lang.Object
fr.inria.rules.integraal.storage.external.rdbms.driver.MySQLDriver
- All Implemented Interfaces:
RDBMSDriver
Driver for MySQL databases
-
Constructor Summary
ConstructorsConstructorDescriptionMySQLDriver(String uri) Creates a new driver over the given jdbc stringMySQLDriver(String host, String dbName, String user, String password) Creates a new driver using the given parameters -
Method Summary
Modifier and TypeMethodDescriptionReturns the base safe INSERT query template.Returns the safe INSERT-SELECT query template.A driver may keep a connection open in order to execute queries faster or create a new one each time Returns a JDBC connection to the target database.getCSVCopyQuery(String tableName, String csvFilePath, char delimiter, int headerSize) Returns the SQL query used to bulk-copy CSV data.Returns the data source handled by this driver.Returns the JDBC connection string.Returns the SQL numeric-column type name used by this driver.Returns the SQL text-column type name used by this driver.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface RDBMSDriver
dropAllIndexes, dropAllTables, getBaseInsertQuery, getBaseSelectFilteredQuery, getBaseSelectQuery, getBaseTableAlias, hasTable
-
Constructor Details
-
MySQLDriver
Creates a new driver using the given parameters- Parameters:
host- the url of the databasedbName- the name of the databaseuser- the username used to connect to the databasepassword- the password used to connect to the database- Throws:
SQLException- iff some error occur
-
MySQLDriver
Creates a new driver over the given jdbc string- Parameters:
uri- jdbc string- Throws:
SQLException- iff some error occur
-
-
Method Details
-
getDatasource
Description copied from interface:RDBMSDriverReturns the data source handled by this driver.- Specified by:
getDatasourcein interfaceRDBMSDriver- Returns:
- the
DataSourcerepresented by this driver
-
getBaseSafeInsertQuery
Description copied from interface:RDBMSDriverReturns the base safe INSERT query template.- Specified by:
getBaseSafeInsertQueryin interfaceRDBMSDriver- Returns:
- the base INSERT query which does not create exceptions in case of duplicates corresponding to this driver
-
getBaseSafeInsertSelectQuery
Description copied from interface:RDBMSDriverReturns the safe INSERT-SELECT query template.- Specified by:
getBaseSafeInsertSelectQueryin interfaceRDBMSDriver- Returns:
- the base INSERT query using a SELECT clause which does not create exceptions in case of duplicates corresponding to this driver
-
getTextFieldName
Description copied from interface:RDBMSDriverReturns the SQL text-column type name used by this driver.- Specified by:
getTextFieldNamein interfaceRDBMSDriver- Returns:
- the name of the Text field corresponding to this driver
-
getNumberFieldName
Description copied from interface:RDBMSDriverReturns the SQL numeric-column type name used by this driver.- Specified by:
getNumberFieldNamein interfaceRDBMSDriver- Returns:
- the name of the Number field corresponding to this driver
-
getConnection
Description copied from interface:RDBMSDriverA driver may keep a connection open in order to execute queries faster or create a new one each time Returns a JDBC connection to the target database.- Specified by:
getConnectionin interfaceRDBMSDriver- Returns:
- a
Connectionfor the database represented by this driver
-
getJDBCString
Description copied from interface:RDBMSDriverReturns the JDBC connection string.- Specified by:
getJDBCStringin interfaceRDBMSDriver- Returns:
- the jdbc connection string
-
getCSVCopyQuery
Description copied from interface:RDBMSDriverReturns the SQL query used to bulk-copy CSV data.- Specified by:
getCSVCopyQueryin interfaceRDBMSDriver- Parameters:
tableName- table name to store datacsvFilePath- path to the csv filedelimiter- delimiter of the csv fileheaderSize- size of the csv header- Returns:
- the query used to copy a CSV file into the database system
-