DataManagerFactory

Overview

This class is used to instantiate a data manager object. This is done to simplify the process of creating a data manager of a given type. Currently it only creates SqlDataManagers. A SQL data manager can be created without the use of this class, but it is simplified greatly through its use.

This class should no longer be used. Use a java.sql.BasicDataSource or com.screenscraper.datamanager.SshDataSource instead. See the SqlDataManager.buildSchemas page for examples

This class is only available for Professional and Enterprise editions of screen-scraper.

getMsSqlDataManager

This method is no longer supported. Use a java.sql.BasicDataSource or com.screenscraper.datamanager.SshDataSource instead. See the SqlDataManager.buildSchemas page for examples.

SqlDataManager dataManagerFactory.getMsSqlDataManager ( ScrapingSession session, String host, String database, String username, String password, String queryString) (professional and enterprise editions only)

Description

Create a MsSQL data manager object.

Parameters

  • session The scraping session that the data manager should be attached to.
  • host The database host (URL and maybe Port), as a string.
  • database The name of the database, as a string.
  • username Username that is being used to access the database, as a string.
  • password The username's associated password, as a string.
  • parameters URL encoded query string, as a string.

Return Values

Returns a SqlDataManager object. If an error is experienced it will be thrown.

Change Log

Version Description
5.0 Available for professional and enterprise editions.

In order to create the MsSQL data manager you will need to make sure to install the appropriate jdbc driver. This can be done by downloading the MsSQL JDBC driver and placing it in the lib/ext folder in the screen-scraper installation directory.

Examples

Create MsSQL Data Manager

 // Import classes
 import com.screenscraper.datamanager.*;
 import org.apache.commons.dbcp.BasicDataSource;

 // Set Variables
 host = "127.0.0.1";
 database = "mydb";
 username = "user";
 password = "pwrd";
 parameters = null;

 // Get MsSQL datamanager
 dm = DataManagerFactory.getMsSqlDataManager( session, host, database, username, password, parameters);

getMySqlDataManager

This method is no longer supported. Use a java.sql.BasicDataSource or com.screenscraper.datamanager.SshDataSource instead. See the SqlDataManager.buildSchemas page for examples.

SqlDataManager dataManagerFactory.getMySqlDataManager ( ScrapingSession session, String host, String database, String username, String password, String parameters ) (professional and enterprise editions only)

Description

Create a MySQL data manager object.

Parameters

  • session The scraping session that the data manager should be attached to.
  • host The database host (URL and maybe Port), as a string.
  • database The name of the database, as a string.
  • username Username that is being used to access the database, as a string.
  • password The username's associated password, as a string.
  • parameters URL encoded query string, as a string.

Return Values

Returns a SqlDataManager object. If an error is experienced it will be thrown.

Change Log

Version Description
5.0 Available for professional and enterprise editions.

In order to create the MySQL data manager you will need to make sure to install the appropriate jdbc driver. This can be done by downloading the MySQL JDBC driver and placing it in the lib/ext folder in the screen-scraper installation directory.

Examples

Create MySQL Data Manager

 // Import classes
 import com.screenscraper.datamanager.*;
 import org.apache.commons.dbcp.BasicDataSource;

 // Set Variables
 host = "127.0.0.1:3306";
 database = "mydb";
 username = "user";
 password = "pwrd";
 parameters = null;

 // Get MySQL datamanager
 dm = DataManagerFactory.getMySqlDataManager( session, host, database, username, password, parameters);

getOracleDataManager

This method is no longer supported. Use a java.sql.BasicDataSource or com.screenscraper.datamanager.SshDataSource instead. See the SqlDataManager.buildSchemas page for examples.

SqlDataManager dataManagerFactory.getOracleDataManager ( ScrapingSession session, String host, String database, String username, String password, String queryString ) (professional and enterprise editions only)

Description

Create an Oracle data manager object.

Parameters

  • session The scraping session that the data manager should be attached to.
  • host The database host (URL and maybe Port), as a string.
  • database The name of the database, as a string.
  • username Username that is being used to access the database, as a string.
  • password The username's associated password, as a string.
  • parameters URL encoded query string, as a string.

Return Values

Returns a SqlDataManager object. If an error is experienced it will be thrown.

Change Log

Version Description
5.0 Available for professional and enterprise editions.

In order to create the Oracle data manager you will need to make sure to install the appropriate jdbc driver. This can be done by downloading the Oracle JDBC driver and placing it in the lib/ext folder in the screen-scraper installation directory.

Examples

Create an Oracle Data Manager

 // Import classes
 import com.screenscraper.datamanager.*;
 import org.apache.commons.dbcp.BasicDataSource;

 // Set Variables
 host = "127.0.0.1:3306";
 database = "mydb";
 username = "user";
 password = "pwrd";
 parameters = null;

 // Get Oracle datamanager
 dm = DataManagerFactory.getOracleDataManager( session, host, database, username, password, parameters);

getPostreSqlDataManager

This method is no longer supported. Use a java.sql.BasicDataSource or com.screenscraper.datamanager.SshDataSource instead. See the SqlDataManager.buildSchemas page for examples.

SqlDataManager dataManagerFactory.getPostreSqlDataManager ( ScrapingSession session, String host, String database, String username, String password, String queryString ) (professional and enterprise editions only)

Description

Create a Postgre data manager object.

Parameters

  • session The scraping session that the data manager should be attached to.
  • host The database host (URL and maybe Port), as a string.
  • database The name of the database, as a string.
  • username Username that is being used to access the database, as a string.
  • password The username's associated password, as a string.
  • parameters URL encoded query string, as a string.

Return Values

Returns a SqlDataManager object. If an error is experienced it will be thrown.

Change Log

Version Description
5.0 Available for professional and enterprise editions.

In order to create the Postgre data manager you will need to make sure to install the appropriate jdbc driver. This can be done by downloading the Postgre JDBC driver and placing it in the lib/ext folder in the screen-scraper installation directory.

Examples

Create a Postgre Data Manager

 // Import classes
 import com.screenscraper.datamanager.*;
 import org.apache.commons.dbcp.BasicDataSource;

 // Set Variables
 host = "127.0.0.1:3306";
 database = "mydb";
 username = "user";
 password = "pwrd";
 parameters = null;

 // Get PostgreSQL datamanager
 dm = DataManagerFactory.getPostreSqlDataManager( session, host, database, username, password, parameters);

getSqliteDataManager

This method is no longer supported. Use a java.sql.BasicDataSource or com.screenscraper.datamanager.SshDataSource instead. See the SqlDataManager.buildSchemas page for examples.

SqlDataManager dataManagerFactory.getSqliteDataManager ( ScrapingSession session, String file, String username, String password ) (professional and enterprise editions only)

Description

Create a SQLite data manager object.

Parameters

  • session The scraping session that the data manager should be attached to.
  • file The file path of the sqlite file, as a string.
  • username Username that is being used to access the database, as a string.
  • password The username's associated password, as a string.

Return Values

Returns a SqlDataManager object. If an error is experienced it will be thrown.

Change Log

Version Description
5.0 Available for professional and enterprise editions.

In order to create the Sqlite data manager you will need to make sure to install the appropriate jdbc driver. This can be done by downloading the Sqlite JDBC driver and placing it in the lib/ext folder in the screen-scraper installation directory.

Examples

Create a SQLite Data Manager

 // Import classes
 import com.screenscraper.datamanager.*;
 import org.apache.commons.dbcp.BasicDataSource;

 // Set Variables
 file = "c:/db/mydb.sqlite";
 username = "user";
 password = "pwrd";

 // Get Sqlite datamanager
 dm = DataManagerFactory.getSqliteDataManager( session, file, username, password);