Connection sqlDataManager.getConnection ( ) (professional and enterprise editions only)


Retrieve the connection object of the data manager. This can be helpful if you want to do something that the data manager cannot do easily, such as query the database.

Be sure to close the connection once it is no longer needed. Failure to do so could exhaust the connection pool used by the datamanger, which will cause the scraping session to hang.


This method does not receive and parameters.

Return Values

Returns a connection object matching the one used in the data manager.

Change Log

Version Description
5.0 Available for professional and enterprise editions.


Retrieve Database Connection

 // Import SQL object
 import java.sql.*;

 // Get datamanager
 dm = session.getv( "DATAMANAGER" );

 // Retrieve connection
 connection = dm.getConnection();

 try {
     PreparedStatement ps = connection.prepareStatement( "UPDATE table SET status=?" );
     ps.setString( 1, session.getv("STATUS") );
 } finally {