Interface IDataManager
public interface IDataManager
Interface to adapt the DataManager for usage as an OSGi service
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
Starts sql transaction for default database connection on the current thread.void
Commits any outstanding transaction on the current thread.createSafeWorker
(String datasourceName) Get worker object to perform some database work.Get worker object to perform some database work for the default portal datasource.createWorker
(String datasourceName) Get worker object to perform some database workvoid
executeSqlScriptFile
(String fileName) void
executeSqlScriptFile
(String fileName, PrintStream terminalWriter, PrintStream spoolWriter, boolean ignoreErrors, Map<String, String> args) void
executeSqlScriptString
(String script, String datasource) Execute Sql script file against default DSNvoid
executeSqlScriptString
(String script, String datasource, boolean ignoreErrors, Map<String, String> args) Execute Sql script file against default DSNReturns connection to a default databasegetConnection
(String datasource) Returns connection to a specific datasourceReturns current database runtime which is setup for active portal database connectionint
Returns name of the default database server type: mssql, oracle, mysqlvoid
release()
Release all connection resourcesvoid
releaseConnection
(Connection conn) Releases connection back to the poolvoid
Rollsback any outstanding transaction on the current thread.
-
Field Details
-
DATA_SERVICE
- See Also:
-
DATA_SERVICE_FOLDER
- See Also:
-
DATA_SERVICE_ALIAS_PREFIX
- See Also:
-
-
Method Details
-
getDefaultServerType
int getDefaultServerType()Returns name of the default database server type: mssql, oracle, mysql- Returns:
ISqlWorker.SERVERTYPE_ORACLE
for oracle orISqlWorker.SERVERTYPE_MSSQL
otherwise
-
createWorker
Get worker object to perform some database work for the default portal datasource.- Throws:
SQLException
-
createWorker
Get worker object to perform some database work- Parameters:
datasourceName
- name of the datasource to create a worker for- Throws:
SQLException
-
createSafeWorker
Get worker object to perform some database work. If configuration doesn't have a datasource with the given name, then the default datasource is used- Parameters:
datasourceName
- name of the datasource to use- Throws:
SQLException
-
beginTran
Starts sql transaction for default database connection on the current thread. See correspondingISqlWorker.beginTran()
method.- Throws:
SQLException
-
commitTran
Commits any outstanding transaction on the current thread. See correspondingISqlWorker.commitTran()
method- Throws:
SQLException
-
rollbackTran
Rollsback any outstanding transaction on the current thread. See correspondingISqlWorker.rollbackTran()
method- Throws:
SQLException
-
getDatabaseRuntime
IDatabaseRuntime getDatabaseRuntime()Returns current database runtime which is setup for active portal database connection -
getConnection
Connection getConnection()Returns connection to a default database -
getConnection
Returns connection to a specific datasource- Parameters:
datasource
- name of the datasource
-
release
void release()Release all connection resources -
releaseConnection
Releases connection back to the pool -
executeSqlScriptFile
void executeSqlScriptFile(String fileName) throws SQLException, ServerBusyException, DeadlockException -
executeSqlScriptFile
void executeSqlScriptFile(String fileName, PrintStream terminalWriter, PrintStream spoolWriter, boolean ignoreErrors, Map<String, String> args) throws SQLException, ServerBusyException, DeadlockException -
executeSqlScriptString
void executeSqlScriptString(String script, String datasource) throws SQLException, ServerBusyException, DeadlockException Execute Sql script file against default DSN -
executeSqlScriptString
void executeSqlScriptString(String script, String datasource, boolean ignoreErrors, Map<String, String> args) throws SQLException, ServerBusyException, DeadlockExceptionExecute Sql script file against default DSN
-