Appendix I. IM Scoring Java Bean code example 297
try {
Connection con = DriverManager.getConnection(url);
String query = "select * from bank.all_customers where client_id
= ?";
PreparedStatement getRecord = con.prepareStatement(query);
getRecord.setString(1,clientID);
ResultSet rs = getRecord.executeQuery();
cluster.doScoring(cluster.loadInputColumns(clientID, rs));
rs.close();
getRecord.close();
}
catch (SQLException sqle) {
System.out.println(sqle.toString());
}
}
}
Setting up the environment variables: The paths.bat file
After you install the IM Scoring Java Beans, you must set up environment
variables before you can use them from the Java applications.
For a Java application to invoke RecordScorer, you must run the script shown in
Example I-2 on a Windows system.
Example: I-2 The paths.bat file
rem -----------------------------
rem
Set PATH and CLASSPATH.
rem -----------------------------
SET PATH=%PATH%;<IMinerX root directory>/bin
SET CLASSPATH=%CLASSPATH%;<IMinerX root directory>/java/xerces.jar
SET CLASSPATH=%CLASSPATH%;<IMinerX root directory>/java/idmscore.jar
298 Enhance Your Business Applications: Simple Integration of Advanced Data Mining Functions

Get Enhance Your Business Applications: Simple Integration of Advanced Data Mining Functions now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.