    001/*
    002 * Licensed to the Apache Software Foundation (ASF) under one or more
    003 * contributor license agreements.  See the NOTICE file distributed with
    004 * this work for additional information regarding copyright ownership.
    005 * The ASF licenses this file to You under the Apache License, Version 2.0
    006 * (the "License"); you may not use this file except in compliance with
    007 * the License.  You may obtain a copy of the License at
    008 *
    009 *      http://www.apache.org/licenses/LICENSE-2.0
    010 *
    011 * Unless required by applicable law or agreed to in writing, software
    012 * distributed under the License is distributed on an "AS IS" BASIS,
    013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    014 * See the License for the specific language governing permissions and
    015 * limitations under the License.
    016 */
    017package org.apache.commons.dbcp2;
    018
    019import java.sql.SQLException;
    020
    021/**
    022 * Defines the attributes and methods that will be exposed via JMX for
    023 * {@link PoolableConnection} instances.
    024 * @since 2.0
    025 */
    026public interface PoolableConnectionMXBean {
    027    // Read-only properties
    028    boolean isClosed() throws SQLException;
    029    //SQLWarning getWarnings() throws SQLException;
    030    String getToString();
    031
    032    // Read-write properties
    033    boolean getAutoCommit() throws SQLException;
    034    void setAutoCommit(boolean autoCommit) throws SQLException;
    035
    036    boolean getCacheState();
    037    void setCacheState(boolean cacheState);
    038
    039    String getCatalog() throws SQLException;
    040    void setCatalog(String catalog) throws SQLException;
    041
    042    int getHoldability() throws SQLException;
    043    void setHoldability(int holdability) throws SQLException;
    044
    045    boolean isReadOnly() throws SQLException;
    046    void setReadOnly(boolean readOnly) throws SQLException;
    047
    048    String getSchema() throws SQLException;
    049    void setSchema(String schema) throws SQLException;
    050
    051    int getTransactionIsolation() throws SQLException;
    052    void setTransactionIsolation(int level) throws SQLException;
    053
    054    // Methods
    055    void clearCachedState();
    056    void clearWarnings() throws SQLException;
    057    void close() throws SQLException;
    058    void reallyClose() throws SQLException;
    059}