} catch(InvocationTargetException ex) {  if (ex.getTargetException() instanceof SQLException && owner != null) owner.connectionErrorOccured(this, (SQLException)ex.getTargetException());  throw ex.getTargetException();
    public Object invoke(Object proxy, Method method, Object[] args)         throws Throwable     {		try {						if (LOG_REENTRANT_ACCESS && invokeEntered)			    logChannel.warn("Re-entrant access detected.", new Exception());						invokeEntered = true;						if (closed) 			    throw new SQLException(				    "Connection " + this + " was closed. Stack trace on close:\n" + 					closeStackTrace + "\nat:\n");			if ((owner != null && !owner.isValid(this)))			    throw new SQLException(				    "This connection owner is not valid anymore.");						if (method.equals(CONNECTION_PREPARE_STATEMENT)){				String statement = (String)args[0];				return handlePrepareStatement(                    statement,                     ResultSet.TYPE_FORWARD_ONLY,                    ResultSet.CONCUR_READ_ONLY);            } else            if (method.equals(CONNECTION_PREPARE_STATEMENT2)) {                String statement = (String)args[0];                Integer resultSetType = (Integer)args[1];                Integer resultSetConcurrency = (Integer)args[2];                return handlePrepareStatement(                    statement,                     resultSetType.intValue(),                     resultSetConcurrency.intValue());			} else			if (method.equals(CONNECTION_COMMIT)) {				handleConnectionCommit();				return Void.TYPE;			} else			if (method.equals(CONNECTION_ROLLBACK)) {				handleConnectionRollback();				return Void.TYPE;			} else			if (method.equals(CONNECTION_CLOSE)) {				handleConnectionClose();				return Void.TYPE;			} else				return method.invoke(connection, args);		} catch(SQLException ex) {						if (owner != null) 				owner.connectionErrorOccured(this, ex);						throw ex;		} finally {			invokeEntered = false;		}    }