Connecting to Data Stores

A BI Beans application typically uses the following data stores:

For your program to access data and metadata, you must connect to these data stores.

Process: Establishing connections and a MetadataManager

To connect to data stores, you must estalish connections and a MetadataManager as described in the following process:

After you have connected to the BI Beans Catalog and to the Oracle OLAP data source, then you can pass the MetadataManager to the QueryBuilder, QueryManager, or CalcBuilder. You can also use the MetadataManager to get information about metadata objects and to save and retrieve Persistable components.

Connecting to the BI Beans Catalog

In the connection to the BI Beans Catalog, you must set environment properties that the persistence service needs, before you call the connect method. You must also set the DriverType property of the Connection to specify that the connection is for the Catalog.

Connecting to the Oracle 9i database

In the connection to the Oracle9i database, you specify parameters that Oracle OLAP requires. Again, you must set the DriverType property of the connection.

If you are connecting to an Oracle9i Release 1 database, then, by default, the Connection object for that database will instantiate the Sun ORB (J2SE 1.3.1). If an ORB has already been created in the application before BI Beans connects to the database, then you must set the existing ORB on BI Beans. Note that BI Beans does not require an ORB if you are connecting to an Oracle9i Release 2 database.

Example: Connecting to data stores

The example performs the following tasks:

The code in the example assumes that the variable session exists and is of type BISession.


//imports import oracle.dss.connection.client.Connection; import oracle.dss.metadatamanager.client.MetadataManager; import oracle.dss.metadataUtil.MDM; // prepares the connection to the Catalog Connection catalogConnection = new Connection(); catalogConnection.setSession(session); catalogConnection.setDriverType(MDU.PERSISTENCE); // uses thick JDBC driver (default for Catalog connection) catalogConnection.setJdbcDriverType("oci8"); catalogConnection.setUsername("JDoe"); catalogConnection.setPassword("1a2b3c"); // MYSERVICE is a local net service name that // has been created using Oracle Net Configuration Assistant catalogConnection.setService("MYSERVICE"); // prepares the connection to the Oracle OLAP data source connection mdmConnection = new Connection(); mdmConnection.setSession(session); mdmConnection.setDriverType(MDU.MDM); // uses thin JDBC driver (default for OLAP connection) mdmConnection.setJdbcDriverType("thin"); mdmConnection.setHostName("myHostName"); mdmConnection.setPortNumber(1521); mdmConnection.setSID("myHostSid"); mdmConnection.setUsername("JDoe"); mdmConnection.setPassword("1a2b3c"); // the following two lines are required only when connecting to an OLAP server // for the Oracle9i Release 1 database mdmConnection.setServerType("OLAPServer"); mdmConnection.setOLAPServiceName("OLAPServer"); // instantiate the MetadataManager MetadataManager manager = new MetadataManager(); manager.setSession(session); // adds the connections to the MetadataManager manager.setConnection(catalogConnection); manager.setConnection(mdmConnection); // starts connections and the MetadataManager manager.attach();

Determining the Database Version in BI Beans