Java Reference
In-Depth Information
Listing 16-3
Connect to KJDM DME
//Create OraConnectionFactory
javax.datamining.resource.ConnectionFactory connFactory
com.kxen.KxJDMImpl.javax.datamining.resource.ConnectionFactoryImpl();
//Create ConnectionSpec
ConnectionSpec connSpec connFactory.getConnectionSpec();
connSpec.setURI("kxjni://localhost/./KxJDM.cfg?lang en&country US");
connSpec.setName("user");
connSpec.setPassword("password");
//Create DME Connection
javax.datamining.resource.Connection dmeConn
connFactory.getConnection(connSpec);
In KJDM, the URI syntax to access datasets allows access to either
files or objects contained in databases. KXEN URI for dataset loca-
tions accepts only two schemes: file and odbc. Note that we have
specified ODBC and not JDBC. This is because KXEN engines are
written in C++ and access data sources through ODBC.
When “file” is selected the following structure is used:
Host: <field ignored>
Port: <field ignored>
Path: <complete path to file>
This is an example:
file:///r:temp/mydata.csv
When “odbc” is selected, the following structure is used:
Host: <field ignored>
Port: <field ignored>
Path: <odbc data source/table name or select statement>
These are some examples of valid KJDM URI:
odbc://kxen_Oracle/select * from TableName?user foo&password foo
odbc://kxen_SqlServer/table1?user foo&password foo
 
Search WWH ::




Custom Search