    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 {@link PoolableConnection} instances.
    023 *
    024 * @since 2.0
    025 */
    026public interface PoolableConnectionMXBean {
    027    // Read-only properties
    028    boolean isClosed() throws SQLException;
    029
    030    // SQLWarning getWarnings() throws SQLException;
    031    String getToString();
    032
    033    // Read-write properties
    034    boolean getAutoCommit() throws SQLException;
    035
    036    void setAutoCommit(boolean autoCommit) throws SQLException;
    037
    038    boolean getCacheState();
    039
    040    void setCacheState(boolean cacheState);
    041
    042    String getCatalog() throws SQLException;
    043
    044    void setCatalog(String catalog) throws SQLException;
    045
    046    int getHoldability() throws SQLException;
    047
    048    void setHoldability(int holdability) throws SQLException;
    049
    050    boolean isReadOnly() throws SQLException;
    051
    052    void setReadOnly(boolean readOnly) throws SQLException;
    053
    054    String getSchema() throws SQLException;
    055
    056    void setSchema(String schema) throws SQLException;
    057
    058    int getTransactionIsolation() throws SQLException;
    059
    060    void setTransactionIsolation(int level) throws SQLException;
    061
    062    // Methods
    063    void clearCachedState();
    064
    065    void clearWarnings() throws SQLException;
    066
    067    void close() throws SQLException;
    068
    069    void reallyClose() throws SQLException;
    070}