Class DataManager
java.lang.Object
com.webmethods.portal.service.sql.DataManager
Deprecated.
DataManager works as a factory class to create SqlWorker instances.
Here is an example of opening a connection to a sql datasource:
String dataSource = "dataSourceName"; ISqlWorker worker = null; try { // get the connection information for the datasource ConnectionInfo conninfo = ConnectionManager.getConnInfo(dataSource); // get a worker instance from the data manager worker = DataManager.createWorker(dataSource); // TODO use one of the execute methods from the worker to // perform the query or update } catch (SQLException e) { // log and report the exception Debug.fatal(e, m_logCategory); throw new PortalException(e); } finally { if (worker != null) { // release the worker so the sql resources can be reclaimed worker.release(); } }
- See Also:
-
ISqlWorker
ConnectionManager
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Deprecated.Starts sql transaction for default database connection on the current thread.static void
Deprecated.Commits any outstanding transaction on the current thread.static ISqlWorker
createSafeWorker
(String datasourceName) Deprecated.Get worker object to perform some database work.static ISqlWorker
Deprecated.Get worker object to perform some database work for the default portal datasource.static ISqlWorker
createWorker
(String datasourceName) Deprecated.Get worker object to perform some database workstatic void
executeSqlScriptFile
(String fileName) Deprecated.static void
executeSqlScriptFile
(String fileName, PrintStream terminalWriter, PrintStream spoolWriter, boolean ignoreErrors, Map<String, String> args) Deprecated.static void
executeSqlScriptString
(String script, String datasource) Deprecated.Execute Sql script file against default DSNstatic void
executeSqlScriptString
(String script, String datasource, boolean ignoreErrors, Map<String, String> args) Deprecated.Execute Sql script file against default DSNstatic Connection
Deprecated.Returns connection to a default databasestatic Connection
getConnection
(String datasource) Deprecated.Returns connection to a specific datasourcestatic IDatabaseRuntime
Deprecated.Returns current database runtime which is setup for active portal database connectionstatic int
Deprecated.Returns name of the default database server type: mssql, oracle, mysqlstatic void
release()
Deprecated.Release all connection resourcesstatic void
releaseConnection
(Connection conn) Deprecated.Releases connection back to the poolstatic void
Deprecated.Rollsback any outstanding transaction on the current thread.
-
Field Details
-
DATA_SERVICE
Deprecated.- See Also:
-
DATA_SERVICE_FOLDER
Deprecated.- See Also:
-
DATA_SERVICE_ALIAS_PREFIX
Deprecated.- See Also:
-
-
Constructor Details
-
DataManager
public DataManager()Deprecated.
-
-
Method Details
-
getDefaultServerType
public static int getDefaultServerType()Deprecated.Returns name of the default database server type: mssql, oracle, mysql- Returns:
ISqlWorker.SERVERTYPE_ORACLE
for oracle orISqlWorker.SERVERTYPE_MSSQL
otherwise
-
createWorker
Deprecated.Get worker object to perform some database work for the default portal datasource.- Throws:
SQLException
-
beginTran
Deprecated.Starts sql transaction for default database connection on the current thread. See correspondingISqlWorker.beginTran()
method.- Throws:
SQLException
-
commitTran
Deprecated.Commits any outstanding transaction on the current thread. See correspondingISqlWorker.commitTran()
method- Throws:
SQLException
-
rollbackTran
Deprecated.Rollsback any outstanding transaction on the current thread. See correspondingISqlWorker.rollbackTran()
method- Throws:
SQLException
-
createWorker
Deprecated.Get worker object to perform some database work- Parameters:
datasourceName
- name of the datasource to create a worker for- Throws:
SQLException
-
createSafeWorker
Deprecated.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
-
getDatabaseRuntime
Deprecated.Returns current database runtime which is setup for active portal database connection -
getConnection
Deprecated.Returns connection to a default database -
getConnection
Deprecated.Returns connection to a specific datasource- Parameters:
datasource
- name of the datasource
-
release
public static void release()Deprecated.Release all connection resources -
releaseConnection
Deprecated.Releases connection back to the pool -
executeSqlScriptFile
public static void executeSqlScriptFile(String fileName) throws SQLException, ServerBusyException, DeadlockException Deprecated. -
executeSqlScriptFile
public static void executeSqlScriptFile(String fileName, PrintStream terminalWriter, PrintStream spoolWriter, boolean ignoreErrors, Map<String, String> args) throws SQLException, ServerBusyException, DeadlockExceptionDeprecated. -
executeSqlScriptString
public static void executeSqlScriptString(String script, String datasource) throws SQLException, ServerBusyException, DeadlockException Deprecated.Execute Sql script file against default DSN -
executeSqlScriptString
public static void executeSqlScriptString(String script, String datasource, boolean ignoreErrors, Map<String, String> args) throws SQLException, ServerBusyException, DeadlockExceptionDeprecated.Execute Sql script file against default DSN
-
IDataManager
interface