The following is an example of requesting a connection to the database:
JDBCJournalSchemaGenerator jsg=new JDBCJournalSchemaGenerator(); Properties env = new Properties(); env.setProperty(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory"); javax.naming.Context ctx = new InitialContext(env); DataSource ds = (DataSource)ctx.lookup("jdbc/ej"); jsg.databaseConnection = ds.getConnection(dbUserID, dbPassword);
This method sets the databaseConnection static attribute of the Schema Generator. The Schema Generator does not use the connection pooling facilities.