public class P2JLoggingDatabaseHelper
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,P2JLoggingDatabaseHelper> |
dbHelpers
Map that includes a helper for each given database.
|
private static CentralLogger |
LOG
Logger.
|
| Constructor and Description |
|---|
P2JLoggingDatabaseHelper(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 P2JLoggingDatabaseHelper |
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 |
insertP2JQueryProfiling(java.lang.String databaseName,
java.lang.String queryType,
java.lang.String fql,
java.lang.Long useCount,
java.lang.Double processingTime,
java.lang.String location,
java.lang.String stackTrace)
Insert a P2j 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,P2JLoggingDatabaseHelper> dbHelpers
private java.sql.Connection connection
public P2JLoggingDatabaseHelper(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 P2JLoggingDatabaseHelper 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 insertP2JQueryProfiling(java.lang.String databaseName,
java.lang.String queryType,
java.lang.String fql,
java.lang.Long useCount,
java.lang.Double processingTime,
java.lang.String location,
java.lang.String stackTrace)
databaseName - The FWD database on which profiling is done.queryType - The query type of the profiled P2j Query.fql - The fql of the profiled P2J Query.useCount - The number of times of the profiled P2J Query was used.processingTime - The amount of time it took to process the query.location - The location of the profiled P2J Query.stackTrace - The stack trace of the profiled P2J 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()