ds.setTransactionIsolationLevel(Integer.parseInt(addr));
ds.setIsolation(addr);
    public Object getObjectInstance(Object obj, Name name, Context nameCtx,                                     Hashtable environment) throws Exception     {                if (!(obj instanceof Reference)) return null;            Reference ref = (Reference)obj;            if (!getClass().getName().equals(ref.getClassName()))            return null;            BasicAbstractConnectionPool ds = createObjectInstance();                int[] addressesToRemove = new int[ref.size()];                for (int i = 0; i < ref.size(); i++) {            RefAddr element = ref.get(i);                        String type = element.getType();            String addr = element.getContent().toString();                        if (REF_BLOCKING_TIMEOUT.equals(type))                ds.setBlockingTimeout(Integer.parseInt(addr));            else            if (REF_MAX_IDLE_TIME.equals(type))                ds.setIdleTimeout(Integer.parseInt(addr));            else            if (REF_LOGIN_TIMEOUT.equals(type))                ds.setLoginTimeout(Integer.parseInt(addr));            else            if (REF_MAX_POOL_SIZE.equals(type))                ds.setMaxConnections(Integer.parseInt(addr));            else            if (REF_MIN_POOL_SIZE.equals(type))                ds.setMinConnections(Integer.parseInt(addr));            else            if (REF_PING_INTERVAL.equals(type))                ds.setPingInterval(Integer.parseInt(addr));            else            if (REF_TX_ISOLATION.equals(type))                ds.setTransactionIsolationLevel(Integer.parseInt(addr));            else            if (REF_RETRY_INTERVAL.equals(type))                ds.setRetryInterval(Integer.parseInt(addr));            else            if (REF_PING_STATEMENT.equals(type))                 ds.setPingStatement(addr);            else            if (REF_POOLING.equals(type))                ds.setPooling(Boolean.valueOf(addr).booleanValue());            else            if (REF_STATEMENT_POOLING.equals(type))                ds.setStatementPooling(Boolean.valueOf(addr).booleanValue());            else            if (REF_MAX_STATEMENTS.equals(type))                ds.setMaxStatements(Integer.parseInt(addr));            else                continue;                        // set flag that we matched the address, so it has to be removed            // we rely on fact that if none address was matched, last else            // clause will be executed and next code will not be executed.            addressesToRemove[i] = 1;        }                // removed matched addresses        for (int i = 0; i < addressesToRemove.length; i++) {            if (addressesToRemove[i] == 1)                ref.remove(i);        }                    return ds;    }