public class SQLLoggingDatabaseHelper
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private java.sql.Connection |
connection
Database connection
|
private static java.util.Map<java.lang.String,SQLLoggingDatabaseHelper> |
dbHelpers
Map that includes a helper for each given database.
|
private static CentralLogger |
LOG
Logger.
|
| Constructor and Description |
|---|
SQLLoggingDatabaseHelper(java.lang.String filename,
java.lang.String user,
java.lang.String pass)
Constructor to instantiate a helper
|
| Modifier and Type | Method and Description |
|---|---|
private void |
closeConnection()
Close the current connection.
|
static SQLLoggingDatabaseHelper |
getDbHelper(java.lang.String databaseName,
java.lang.String fileName,
java.lang.String user,
java.lang.String pass)
Get the logging database helper of a specific database.
|
java.lang.Long |
insertSQLQueryProfiling(java.lang.String databaseName,
java.lang.String statement,
java.lang.Double executionTime,
int batchSize,
java.lang.String stackTrace)
Insert a SQL query profiling record.
|
private void |
openConnection(java.lang.String url,
java.lang.String user,
java.lang.String pass)
Open a new connection to the database (if one already opened, it will close it first).
|
private static final CentralLogger LOG
private static final java.util.Map<java.lang.String,SQLLoggingDatabaseHelper> dbHelpers
private java.sql.Connection connection
public SQLLoggingDatabaseHelper(java.lang.String filename,
java.lang.String user,
java.lang.String pass)
filename - The filename of the h2 database to be created.user - The user of the h2 database to be created.pass - The password of the h2 database to be created.public static SQLLoggingDatabaseHelper getDbHelper(java.lang.String databaseName, java.lang.String fileName, java.lang.String user, java.lang.String pass)
databaseName - The name of the database in use.fileName - The filename of the H2 database.user - The user of the H2 database.pass - The password of the H2 database.public java.lang.Long insertSQLQueryProfiling(java.lang.String databaseName,
java.lang.String statement,
java.lang.Double executionTime,
int batchSize,
java.lang.String stackTrace)
databaseName - The FWD database on which profiling is done.statement - The SQL statement that is profiled.executionTime - The execution time of the profiled SQL Query.batchSize - The batch size of the profiled SQL Query.stackTrace - The stack trace of the profiled SQL Query.private void openConnection(java.lang.String url,
java.lang.String user,
java.lang.String pass)
url - The connection URL of the database.user - The database user configured in directory.xmlpass - The database password configured in directory.xmlprivate void closeConnection()