There are different possibilities to initialize Signsoft intelliBO in a programmatic way.
First you can make varios settings on the PersistenceManagerFactory . Please remark, that some of the settings are Signsoft intelliBO extensions:
PersistenceManagerFactoryImpl factory =
new PersistenceManagerFactoryImpl();
factory.setConnectionDriverName("org.h2.Driver");
factory.setConnectionURL("jdbc:h2:/database/data");
factory.setConnectionUserName("");
factory.setConnectionPassword("");
factory.setConnectionInfoName
("com.signsoft.ibo.dbsupport.h2.H2DatabaseInfo");
An other way is to use the com.signsoft.ibo.conf.ConfigurationService object on a provided PersistenceManager . Unlike the first mentioned approach the configuration can be different for each PersistenceManager :
PersistenceManagerFactoryImpl factory = new PersistenceManagerFactoryImpl(); PersistenceManagerImpl pm = (PersistenceManagerImpl)factory.getPersistenceManager(); ConfigurationService cs = pm.getConfigurationService(); cs.setOptimistic(true);
There is a special configuration class for the queries:
com.signsoft.ibo.conf.QueryConfiguration qc =
pm.getConfigurationService().getQueryConfiguration();
as well as for the Cache:
com.signsoft.cache.confCacheConfiguration qc =
pm.getConfigurationService().getCacheConfiguration();
and - only until Signsoft intelliBO version 4.1 - for the Logging:
com.signsoft.logging.conf.LoggingConfiguration qc =
pm.getConfigurationService().getLoggingConfiguration();
Please note: to configure the connection pool (see "Resource Setup") in a programmatically way, first you have to create a new com.signsoft.ibo.core.services.impl.server.rm.pool.ibods.IntelliBOPoolConfiguration object and assign it to the PersistenceManagerFactory.
IntelliBOPoolConfiguration ip = new IntelliBOPoolConfiguration(); ... pmf.setConnectionPoolConfiguration(ip);