public static Connection getConnection( String jndiName ) throws DBDatasourceServiceException, SQLException { JndiDatasourceService jndiService = new JndiDatasourceService(); DataSource ds = jndiService.getDataSource( jndiName ); return ds.getConnection(); }
private IDBDatasourceService getDBDatasourceService() throws ObjectFactoryException { // // Our new datasource stuff is provided for running queries and acquiring data. It is // NOT there for the inner workings of the platform. So, the Hibernate datasource should ALWAYS // be provided by JNDI. However, the class could be twiddled so that it will use the factory. // // And, since the default shipping condition should be to NOT use the factory (and force JNDI), // I've reversed the logic in the class to have the negative condition first (the default execution // path). // // Marc - BISERVER-2004 // if ( !useNewDatasourceService ) { return new JndiDatasourceService(); } else { IDBDatasourceService datasourceService = PentahoSystem.getObjectFactory().get( IDBDatasourceService.class, null ); return datasourceService; } }
@Override protected DataSource retrieve( String dsName ) throws DBDatasourceServiceException { DataSource ds; try { ds = getJndiDataSource( dsName ); if ( ds != null ) { cacheManager.putInRegionCache( IDBDatasourceService.JDBC_DATASOURCE, dsName, ds ); } } catch ( DBDatasourceServiceException dse ) { throw new DBDatasourceServiceException( Messages.getInstance().getErrorString( "DatasourceService.ERROR_0003_UNABLE_TO_GET_JNDI_DATASOURCE" ), dse ); //$NON-NLS-1$ } return ds; }
private static IDBDatasourceService getDatasourceService() throws ObjectFactoryException { // // Our new datasource stuff is provided for running queries and acquiring data. It is // NOT there for the inner workings of the platform. So, the Hibernate datasource should ALWAYS // be provided by JNDI. However, the class could be twiddled so that it will use the factory. // // And, since the default shipping condition should be to NOT use the factory (and force JNDI), // I've reversed the logic in the class to have the negative condition first (the default execution // path). // // Marc - BISERVER-2004 // if ( !useNewDatasourceService ) { return new JndiDatasourceService(); } else { IDBDatasourceService datasourceService = PentahoSystem.getObjectFactory().get( IDBDatasourceService.class, null ); return datasourceService; } }
private IDBDatasourceService getQuartzDatasourceService( IPentahoSession session ) throws ObjectFactoryException { // // Our new datasource stuff is provided for running queries and acquiring data. It is // NOT there for the inner workings of the platform. So, the Quartz datasource should ALWAYS // be provided by JNDI. However, the class could be twiddled so that it will use the factory. // // And, since the default shipping condition should be to NOT use the factory (and force JNDI), // I've reversed the logic in the class to have the negative condition first (the default execution // path). // // Marc - BISERVER-2004 // if ( !useNewDatasourceService ) { return new JndiDatasourceService(); } else { IDBDatasourceService datasourceService = PentahoSystem.getObjectFactory().get( IDBDatasourceService.class, session ); return datasourceService; } }
@Parameterized.Parameters public static Collection services() { return Arrays.asList( new Object[][] { { new JndiDatasourceService(), "test0" }, { new NonPooledOrJndiDatasourceService(), "test1" }, { new PooledOrJndiDatasourceService(), "test2" } } ); }