Below are the code for createConnectionFactory and createConn.
private static ConnectionFactory createConnectionFactory(String strDomain, String strOrganization)
throws FN_IS_ISException, ResourceException {
FN_IS_SpiManagedConnectionFactory fnISSpiManagedConnectionFactory = new FN_IS_SpiManagedConnectionFactory();
fnISSpiManagedConnectionFactory.setDomainName(strDomain); // domain
fnISSpiManagedConnectionFactory.setOrganizationName(strOrganization); // organization
fnISSpiManagedConnectionFactory.setProductName("IBM FileNet Image Services Resource Adapter"); // FILENET
fnISSpiManagedConnectionFactory.setLogFileName("ISRA.log"); // logFileName
fnISSpiManagedConnectionFactory.setLoggingLevel(2);
fnISSpiManagedConnectionFactory.setLoggingMode(2);
fnISSpiManagedConnectionFactory.setDeploymentInstance(1);
return (ConnectionFactory) fnISSpiManagedConnectionFactory.createConnectionFactory();
}
private static Connection createConn(ConnectionFactory cnFac, String strUserID, String strPassword)
throws FN_IS_ISException, ResourceException {
FN_IS_CciConnectionSpec fnISCCICS = new FN_IS_CciConnectionSpec();
fnISCCICS.setUserName(strUserID);
fnISCCICS.setPassword(strPassword);
fnISCCICS.setLoginType(0);
return (Connection) cnFac.getConnection(fnISCCICS);
}