java – Make a connection to ASI Granite

java – Make a connection to ASI Granite

the ASI need a connection ticketName, without which you can not open a connection.

Here is the correct code, I added the parameter written above:

public void connect(String ticketName) throws Exception {
             if (prop != null) {
                   ConnectionFactoryASI.setProtocol(prop);
                   ConnectionFactoryASI.setDataObjectFactoryType(prop);
                   serviceFactory = ConnectionFactoryASI.getServiceFactory(prop, ticketName);
             } else {
                   serviceFactory = ConnectionFactoryASI.getServiceFactory(ticketName, user);
             }
             dataObjectFactory = serviceFactory.getDataObjectFactory();
            setUser(serviceFactory.getClientSession().getLoginName());
             logger.debug(ASI HostName:  + serviceFactory.getClientSession().getHostName()
                          + , DatabaseName:  + serviceFactory.getClientSession().getDatabaseName()
                          + , DbHostName:  + serviceFactory.getClientSession().getDbHostName());
      }

java – Make a connection to ASI Granite

Leave a Reply

Your email address will not be published. Required fields are marked *