Skip navigation links

Oracle Data Mining Java API Reference
11g Release 1 (11.1)

B28132-01


oracle.dmt.jdm.resource
Class OraConnectionFactory

java.lang.Object
  extended byoracle.dmt.jdm.resource.OraConnectionFactory

All Implemented Interfaces:
javax.datamining.resource.ConnectionFactory, javax.datamining.Factory, javax.naming.Referenceable, java.io.Serializable

public class OraConnectionFactory
extends java.lang.Object
implements javax.datamining.resource.ConnectionFactory, java.io.Serializable, javax.naming.Referenceable

OraConnectionFactory is an oracle extension of javax.datamining.resource.ConnectionFactory. ConnectionFactory can either be instantiated using OraConnectionFactory constructor or can be registered in JNDI server to access the connection instance in a vendor neutral architecture.
Following code illustrates these two approaches to create a connection factory.

//Case-1: Using OraConnectionFactory constructor.
javax.datamining.resource.ConnectionFactory connFactory =
oracle.dmt.jdm.resource.OraConnectionFactory();
ConnectionSpec cSpec = connFactory.getConnectionSpec();
cSpec.setURI("jdbc:oracle:thin:@host:port:sid");
cSpec.setName("dmuser");
cSpec.setPassword("dmuser");
connFactory.setConnectionSpec(cSpec);


//Case-2: Using JNDI
// Setup the initial context to connect to the JNDI server
Hashtable env = new Hashtable();
env.put( Context.INITIAL_CONTEXT_FACTORY,
"oracle.dmt.jdm.resource.OraConnectionFactory" );
env.put( Context.PROVIDER_URL, "http://myHost:myPort/myService" );
env.put( Context.SECURITY_PRINCIPAL, "user" );
env.put( Context.SECURITY_CREDENTIALS, "password" );
InitialContext jndiContext = new javax.naming.InitialContext( env );
// Perform JNDI lookup to obtain the connection factory
javax.datamining.resource.ConnectionFactory dmeConnFactory =
(ConnectionFactory) jndiContext.lookup("java:comp/env/jdm/MyServer");
//Lookup ConnectionFactory
javax.datamining.resource.ConnectionFactory connFactory =
(ConnectionFactory) jndiContext.lookup("java:comp/env/jdm/MyServer");

See Also:
Factory, Serialized Form

Constructor Summary
OraConnectionFactory()
          Creates default connection factory instance.
OraConnectionFactory(oracle.jdbc.pool.OracleDataSource dataSource)
          Creates connection factory using the specified oracle data source.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

OraConnectionFactory

public OraConnectionFactory()
                     throws javax.datamining.JDMException
Creates default connection factory instance.
Throws:
javax.datamining.JDMException

OraConnectionFactory

public OraConnectionFactory(oracle.jdbc.pool.OracleDataSource dataSource)
                     throws javax.datamining.JDMException
Creates connection factory using the specified oracle data source. To create DME Connection it uses the specified data source.
Parameters:
dataSource -
Throws:
javax.datamining.JDMException

Skip navigation links

Oracle Data Mining Java API Reference
11g Release 1 (11.1)

B28132-01


Copyright © 2005-2007 Oracle. All rights reserved.