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 * @version $Id: PoolableConnectionMXBean.java 1649430 2015-01-04 21:29:32Z tn $
025 * @since 2.0
026 */
027public interface PoolableConnectionMXBean {
028    // Read-only properties
029    boolean isClosed() throws SQLException;
030    //SQLWarning getWarnings() throws SQLException;
031    String getToString();
032
033    // Read-write properties
034    boolean getAutoCommit() throws SQLException;
035    void setAutoCommit(boolean autoCommit) throws SQLException;
036
037    boolean getCacheState();
038    void setCacheState(boolean cacheState);
039
040    String getCatalog() throws SQLException;
041    void setCatalog(String catalog) throws SQLException;
042
043    int getHoldability() throws SQLException;
044    void setHoldability(int holdability) throws SQLException;
045
046    boolean isReadOnly() throws SQLException;
047    void setReadOnly(boolean readOnly) throws SQLException;
048
049    String getSchema() throws SQLException;
050    void setSchema(String schema) throws SQLException;
051
052    int getTransactionIsolation() throws SQLException;
053    void setTransactionIsolation(int level) throws SQLException;
054
055    // Methods
056    void clearCachedState();
057    void clearWarnings() throws SQLException;
058    void close() throws SQLException;
059    void reallyClose() throws SQLException;
060}