|
Oracle Data Mining Java API Reference 10g Release 2 (10.2) B14341-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.dmt.jdm.resource.OraConnectionFactory
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");
Factory
, Serialized FormConstructor 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 |
public OraConnectionFactory() throws javax.datamining.JDMException
javax.datamining.JDMException
public OraConnectionFactory(oracle.jdbc.pool.OracleDataSource dataSource) throws javax.datamining.JDMException
dataSource
-javax.datamining.JDMException
|
Oracle Data Mining Java API Reference 10g Release 2 (10.2) B14341-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |