001: /*
002: * Distributed as part of c3p0 v.0.9.1.2
003: *
004: * Copyright (C) 2005 Machinery For Change, Inc.
005: *
006: * Author: Steve Waldman <swaldman@mchange.com>
007: *
008: * This library is free software; you can redistribute it and/or modify
009: * it under the terms of the GNU Lesser General Public License version 2.1, as
010: * published by the Free Software Foundation.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
015: * GNU Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public License
018: * along with this software; see the file LICENSE. If not, write to the
019: * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
020: * Boston, MA 02111-1307, USA.
021: */
022:
023: package com.mchange.v2.c3p0.impl;
024:
025: import java.sql.*;
026: import java.util.Set;
027: import com.mchange.v2.sql.filter.FilterDatabaseMetaData;
028:
029: final class SetManagedDatabaseMetaData extends FilterDatabaseMetaData {
030: Set activeResultSets;
031: Connection returnableProxy;
032:
033: SetManagedDatabaseMetaData(DatabaseMetaData inner,
034: Set activeResultSets, Connection returnableProxy) {
035: super (inner);
036: this .activeResultSets = activeResultSets;
037: this .returnableProxy = returnableProxy;
038: }
039:
040: public Connection getConnection() throws SQLException {
041: return returnableProxy;
042: }
043:
044: public ResultSet getProcedures(String a, String b, String c)
045: throws SQLException {
046: return new NullStatementSetManagedResultSet(inner
047: .getProcedures(a, b, c), activeResultSets);
048: }
049:
050: public ResultSet getProcedureColumns(String a, String b, String c,
051: String d) throws SQLException {
052: return new NullStatementSetManagedResultSet(inner
053: .getProcedureColumns(a, b, c, d), activeResultSets);
054: }
055:
056: public ResultSet getTables(String a, String b, String c, String[] d)
057: throws SQLException {
058: return new NullStatementSetManagedResultSet(inner.getTables(a,
059: b, c, d), activeResultSets);
060: }
061:
062: public ResultSet getSchemas() throws SQLException {
063: return new NullStatementSetManagedResultSet(inner.getSchemas(),
064: activeResultSets);
065: }
066:
067: public ResultSet getCatalogs() throws SQLException {
068: return new NullStatementSetManagedResultSet(
069: inner.getCatalogs(), activeResultSets);
070: }
071:
072: public ResultSet getTableTypes() throws SQLException {
073: return new NullStatementSetManagedResultSet(inner
074: .getTableTypes(), activeResultSets);
075: }
076:
077: public ResultSet getColumns(String a, String b, String c, String d)
078: throws SQLException {
079: return new NullStatementSetManagedResultSet(inner.getColumns(a,
080: b, c, d), activeResultSets);
081: }
082:
083: public ResultSet getColumnPrivileges(String a, String b, String c,
084: String d) throws SQLException {
085: return new NullStatementSetManagedResultSet(inner
086: .getColumnPrivileges(a, b, c, d), activeResultSets);
087: }
088:
089: public ResultSet getTablePrivileges(String a, String b, String c)
090: throws SQLException {
091: return new NullStatementSetManagedResultSet(inner
092: .getTablePrivileges(a, b, c), activeResultSets);
093: }
094:
095: public ResultSet getBestRowIdentifier(String a, String b, String c,
096: int d, boolean e) throws SQLException {
097: return new NullStatementSetManagedResultSet(inner
098: .getBestRowIdentifier(a, b, c, d, e), activeResultSets);
099: }
100:
101: public ResultSet getVersionColumns(String a, String b, String c)
102: throws SQLException {
103: return new NullStatementSetManagedResultSet(inner
104: .getVersionColumns(a, b, c), activeResultSets);
105: }
106:
107: public ResultSet getPrimaryKeys(String a, String b, String c)
108: throws SQLException {
109: return new NullStatementSetManagedResultSet(inner
110: .getPrimaryKeys(a, b, c), activeResultSets);
111: }
112:
113: public ResultSet getImportedKeys(String a, String b, String c)
114: throws SQLException {
115: return new NullStatementSetManagedResultSet(inner
116: .getImportedKeys(a, b, c), activeResultSets);
117: }
118:
119: public ResultSet getExportedKeys(String a, String b, String c)
120: throws SQLException {
121: return new NullStatementSetManagedResultSet(inner
122: .getExportedKeys(a, b, c), activeResultSets);
123: }
124:
125: public ResultSet getCrossReference(String a, String b, String c,
126: String d, String e, String f) throws SQLException {
127: return new NullStatementSetManagedResultSet(inner
128: .getCrossReference(a, b, c, d, e, f), activeResultSets);
129: }
130:
131: public ResultSet getTypeInfo() throws SQLException {
132: return new NullStatementSetManagedResultSet(
133: inner.getTypeInfo(), activeResultSets);
134: }
135:
136: public ResultSet getIndexInfo(String a, String b, String c,
137: boolean d, boolean e) throws SQLException {
138: return new NullStatementSetManagedResultSet(inner.getIndexInfo(
139: a, b, c, d, e), activeResultSets);
140: }
141:
142: public ResultSet getUDTs(String a, String b, String c, int[] d)
143: throws SQLException {
144: return new NullStatementSetManagedResultSet(inner.getUDTs(a, b,
145: c, d), activeResultSets);
146: }
147: }
|