001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
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 GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package org.jboss.test.jca.jdbc;
023:
024: import java.sql.Connection;
025: import java.sql.SQLException;
026: import java.sql.Statement;
027: import java.sql.PreparedStatement;
028: import java.sql.CallableStatement;
029: import java.sql.DatabaseMetaData;
030: import java.util.Map;
031: import java.sql.SQLWarning;
032: import java.sql.Savepoint;
033:
034: /**
035: * TestConnection.java
036: *
037: *
038: * Created: Fri Feb 14 13:19:39 2003
039: *
040: * @author <a href="mailto:d_jencks@users.sourceforge.net">David Jencks</a>
041: * @version
042: */
043:
044: public class TestConnection implements Connection {
045:
046: private TestDriver driver;
047:
048: private boolean autocommit;
049:
050: private boolean closed;
051:
052: public TestConnection(TestDriver driver) {
053: this .driver = driver;
054: }
055:
056: public void setFail(boolean fail) {
057: driver.setFail(fail);
058: }
059:
060: public int getClosedCount() {
061: return driver.getClosedCount();
062: }
063:
064: // Implementation of java.sql.Connection
065:
066: public Statement createStatement(int n, int n1, int n2)
067: throws SQLException {
068: return null;
069: }
070:
071: public void clearWarnings() {
072: }
073:
074: public void close() {
075: closed = true;
076: driver.connectionClosed();
077: }
078:
079: public void commit() {
080: }
081:
082: public Statement createStatement() throws SQLException {
083: return new TestStatement(driver);
084: }
085:
086: public Statement createStatement(int rst, int rsc)
087: throws SQLException {
088: return null;
089: }
090:
091: public boolean getAutoCommit() {
092: return autocommit;
093: }
094:
095: public void setAutoCommit(boolean autocommit) {
096: this .autocommit = autocommit;
097: }
098:
099: public String getCatalog() {
100: return null;
101: }
102:
103: public DatabaseMetaData getMetaData() {
104: return null;
105: }
106:
107: public int getTransactionIsolation() {
108: return 0;
109: }
110:
111: public Map getTypeMap() {
112: return null;
113: }
114:
115: public SQLWarning getWarnings() {
116: return null;
117: }
118:
119: public boolean isClosed() {
120: return closed;
121: }
122:
123: public boolean isReadOnly() {
124: return false;
125: }
126:
127: public String nativeSQL(String sql) {
128: return sql;
129: }
130:
131: public CallableStatement prepareCall(String sql) {
132: return null;
133: }
134:
135: public CallableStatement prepareCall(String sql, int rst) {
136: return null;
137: }
138:
139: public CallableStatement prepareCall(String sql, int[] rst) {
140: return null;
141: }
142:
143: public CallableStatement prepareCall(String sql, int rst, int rsc) {
144: return null;
145: }
146:
147: public CallableStatement prepareCall(String sql, String[] rst) {
148: return null;
149: }
150:
151: public CallableStatement prepareCall(String sql, int rst, int rsc,
152: int i) {
153: return null;
154: }
155:
156: public PreparedStatement prepareStatement(String sql) {
157: return new TestPreparedStatement(driver);
158: }
159:
160: public PreparedStatement prepareStatement(String sql, int rst,
161: int rsc) {
162: return new TestPreparedStatement(driver);
163: }
164:
165: public PreparedStatement prepareStatement(String sql, int rst) {
166: return null;
167: }
168:
169: public PreparedStatement prepareStatement(String sql, int[] rst) {
170: return null;
171: }
172:
173: public PreparedStatement prepareStatement(String sql, String[] rst) {
174: return null;
175: }
176:
177: public PreparedStatement prepareStatement(String sql, int rst,
178: int rsc, int i) {
179: return null;
180: }
181:
182: public void rollback() {
183: }
184:
185: public void setCatalog(String cat) {
186: }
187:
188: public void setReadOnly(boolean r0) {
189: }
190:
191: public void setTransactionIsolation(int level) {
192: }
193:
194: public void setTypeMap(Map map) {
195: }
196:
197: public void setHoldability(int h) {
198: }
199:
200: public int getHoldability() {
201: return 0;
202: }
203:
204: public Savepoint setSavepoint() {
205: return null;
206: }
207:
208: public Savepoint setSavepoint(String name) {
209: return null;
210: }
211:
212: public void rollback(Savepoint s) {
213: }
214:
215: public void commit(Savepoint s) {
216: }
217:
218: public void releaseSavepoint(Savepoint s) {
219: }
220:
221: }// TestConnection
|