public class DatabaseConnection
extends java.lang.Object
Constructor and Description |
---|
DatabaseConnection(java.util.HashMap<java.lang.String,java.lang.String> pluginMap) |
Modifier and Type | Method and Description |
---|---|
void |
closeConnection()
Close MySQL database connection
|
void |
commitTransaction()
Finish a transaction in MqSQL database and commit changes
|
java.lang.Boolean |
executeQuery_NOTUSED(java.lang.String query) |
java.lang.String[][] |
executeQuery(java.lang.String query)
Execute the SQL query
|
int |
executeQueryUpdate(java.lang.String query)
Execute the SQL query
|
int |
getCountFromDatabase(java.lang.String query)
Return the count of results for a SQL query
|
java.sql.PreparedStatement |
getPreparedStatement(java.lang.String query)
Get prepared statement
|
java.sql.PreparedStatement |
getPreparedStatement(java.lang.String query,
int flags)
Get prepared statement with flags
|
java.lang.String[][] |
getResultsFromDatabase(java.lang.String query)
Execute SQL query in MySQL database
|
void |
initTransaction()
Initilize a transaction in MqSQL database
|
java.sql.ResultSet |
runSqlQuery(java.lang.String query)
Execute SQL query in MySQL database
|
public DatabaseConnection(java.util.HashMap<java.lang.String,java.lang.String> pluginMap)
public void closeConnection()
public java.sql.ResultSet runSqlQuery(java.lang.String query) throws java.sql.SQLException
query
- the SQL queryResultSet
objectjava.sql.SQLException
- the SQL exceptionpublic java.lang.Boolean executeQuery_NOTUSED(java.lang.String query) throws java.sql.SQLException
java.sql.SQLException
public java.sql.PreparedStatement getPreparedStatement(java.lang.String query) throws java.sql.SQLException
query
- the SQL queryPreparedStatement
objectjava.sql.SQLException
- the SQL exceptionpublic java.sql.PreparedStatement getPreparedStatement(java.lang.String query, int flags) throws java.sql.SQLException
query
- the SQL queryflags
- the flagPreparedStatement
objectjava.sql.SQLException
- the SQL exceptionpublic void initTransaction() throws java.sql.SQLException
java.sql.SQLException
- if initialization failspublic void commitTransaction() throws java.sql.SQLException
java.sql.SQLException
- If a rollback failspublic java.lang.String[][] getResultsFromDatabase(java.lang.String query)
The SQL query is execute in MySQL database and return the results as an multi-dimension string array
query
- SQL querypublic java.lang.String[][] executeQuery(java.lang.String query)
This function executes the SQL query in the database as prepared statement.
query
- the SQL querynull
otherwisepublic int executeQueryUpdate(java.lang.String query)
This function executes the SQL query in the database as prepared statement and returns the generated keys.
query
- the SQL query-1
otherwisepublic int getCountFromDatabase(java.lang.String query)
The function execute the SQL query and return the count of itemsets that has been found in the database
query
- SQL queryCopyright © 2019 Citunius GmbH. All Rights Reserved.