Class DataManager

java.lang.Object
com.webmethods.portal.service.sql.DataManager

@Deprecated public class DataManager extends Object
Deprecated.
left for backward compatibility. Use the OSGi service registered for the IDataManager interface
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: