Package marauroa.server.db.adapter
Class MySQLDatabaseAdapter
java.lang.Object
marauroa.server.db.adapter.AbstractDatabaseAdapter
marauroa.server.db.adapter.MySQLDatabaseAdapter
- All Implemented Interfaces:
DatabaseAdapter
abstracts from MySQL specifications
- Author:
- hendrik
-
Field Summary
Fields inherited from class marauroa.server.db.adapter.AbstractDatabaseAdapter
connection, resultSets, statements -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedcreates a new MySQLDatabaseAdapter for test purposes, without connection to the DBMySQLDatabaseAdapter(Properties connInfo)creates a new MySQLDatabaseAdapter -
Method Summary
Modifier and TypeMethodDescriptionprotected ConnectioncreateConnection(Properties connInfo)This method creates the real connection to database.protected StringrewriteSql(String sql)rewrites CREATE TABLE statements to add TYPE=InnoDBMethods inherited from class marauroa.server.db.adapter.AbstractDatabaseAdapter
close, commit, doesColumnExist, doesTableExist, execute, execute, executeBatch, getColumnLength, getLastInsertId, isConnectionError, prepareStatement, query, querySingleCellInt, rollback, verifyConnection
-
Constructor Details
-
MySQLDatabaseAdapter
creates a new MySQLDatabaseAdapter- Parameters:
connInfo- parameters specifying the connection- Throws:
DatabaseConnectionException- if the connection cannot be established.
-
MySQLDatabaseAdapter
creates a new MySQLDatabaseAdapter for test purposes, without connection to the DB- Throws:
DatabaseConnectionException- if the connection cannot be established.
-
-
Method Details
-
createConnection
protected Connection createConnection(Properties connInfo) throws SQLException, DatabaseConnectionExceptionDescription copied from class:AbstractDatabaseAdapterThis method creates the real connection to database.- Overrides:
createConnectionin classAbstractDatabaseAdapter- Parameters:
connInfo- connection information like url, username and password- Returns:
- a connection to the database
- Throws:
SQLException- if the connection cannot be established.DatabaseConnectionException- if the connection cannot be established.
-
rewriteSql
rewrites CREATE TABLE statements to add TYPE=InnoDB- Overrides:
rewriteSqlin classAbstractDatabaseAdapter- Parameters:
sql- original SQL statement- Returns:
- modified SQL statement
- Throws:
SQLException- in case of a database error
-