private IJdbcClient createClient ( IPolicyContext context , JDBCIdentitySource config ) throws Throwable { IJdbcComponent jdbcComponent = context . getComponent ( IJdbcComponent . class ) ; if ( config . getType ( ) == JDBCType . datasource || config . getType ( ) == null ) { DataSource ds = lookupDatasource ( config ) ; return jdbcComponent . create ( ds ) ; } if ( config . getType ( ) == JDBCType . url ) { JdbcOptionsBean options = new JdbcOptionsBean ( ) ; options . setJdbcUrl ( config . getJdbcUrl ( ) ) ; options . setUsername ( config . getUsername ( ) ) ; options . setPassword ( config . getPassword ( ) ) ; options . setAutoCommit ( true ) ; return jdbcComponent . createStandalone ( options ) ; } throw new Exception ( "Unknown JDBC options." ) ; //$NON-NLS-1$ }
Creates the appropriate jdbc client .