KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > jca > jdbc > TestConnection


1 /*
2  * JBoss, Home of Professional Open Source
3  * Copyright 2005, JBoss Inc., and individual contributors as indicated
4  * by the @authors tag. See the copyright.txt in the distribution for a
5  * full listing of individual contributors.
6  *
7  * This is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License as
9  * published by the Free Software Foundation; either version 2.1 of
10  * the License, or (at your option) any later version.
11  *
12  * This software is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this software; if not, write to the Free
19  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21  */

22 package org.jboss.test.jca.jdbc;
23
24 import java.sql.Connection JavaDoc;
25 import java.sql.SQLException JavaDoc;
26 import java.sql.Statement JavaDoc;
27 import java.sql.PreparedStatement JavaDoc;
28 import java.sql.CallableStatement JavaDoc;
29 import java.sql.DatabaseMetaData JavaDoc;
30 import java.util.Map JavaDoc;
31 import java.sql.SQLWarning JavaDoc;
32 import java.sql.Savepoint JavaDoc;
33
34
35 /**
36  * TestConnection.java
37  *
38  *
39  * Created: Fri Feb 14 13:19:39 2003
40  *
41  * @author <a HREF="mailto:d_jencks@users.sourceforge.net">David Jencks</a>
42  * @version
43  */

44
45 public class TestConnection implements Connection JavaDoc {
46
47    private TestDriver driver;
48
49    private boolean autocommit;
50
51    private boolean closed;
52
53    public TestConnection(TestDriver driver)
54    {
55       this.driver = driver;
56    }
57
58    public void setFail(boolean fail)
59    {
60       driver.setFail(fail);
61    }
62
63    public int getClosedCount()
64    {
65       return driver.getClosedCount();
66    }
67
68    // Implementation of java.sql.Connection
69

70    public Statement JavaDoc createStatement(int n, int n1, int n2) throws SQLException JavaDoc {
71       return null;
72    }
73
74    public void clearWarnings()
75    {
76    }
77
78    public void close()
79    {
80       closed = true;
81       driver.connectionClosed();
82    }
83
84    public void commit()
85    {
86    }
87
88    public Statement JavaDoc createStatement() throws SQLException JavaDoc
89    {
90       return new TestStatement(driver);
91    }
92
93    public Statement JavaDoc createStatement(int rst, int rsc) throws SQLException JavaDoc
94    {
95       return null;
96    }
97
98    public boolean getAutoCommit()
99    {
100       return autocommit;
101    }
102
103    public void setAutoCommit(boolean autocommit)
104    {
105       this.autocommit = autocommit;
106    }
107
108    public String JavaDoc getCatalog()
109    {
110       return null;
111    }
112
113    public DatabaseMetaData JavaDoc getMetaData()
114    {
115       return null;
116    }
117
118    public int getTransactionIsolation()
119    {
120       return 0;
121    }
122
123    public Map JavaDoc getTypeMap()
124    {
125       return null;
126    }
127
128    public SQLWarning JavaDoc getWarnings()
129    {
130       return null;
131    }
132
133    public boolean isClosed()
134    {
135       return closed;
136    }
137
138    public boolean isReadOnly()
139    {
140       return false;
141    }
142
143    public String JavaDoc nativeSQL(String JavaDoc sql)
144    {
145       return sql;
146    }
147
148    public CallableStatement JavaDoc prepareCall(String JavaDoc sql)
149    {
150       return null;
151    }
152
153    public CallableStatement JavaDoc prepareCall(String JavaDoc sql, int rst)
154    {
155       return null;
156    }
157
158    public CallableStatement JavaDoc prepareCall(String JavaDoc sql, int[] rst)
159    {
160       return null;
161    }
162
163    public CallableStatement JavaDoc prepareCall(String JavaDoc sql, int rst, int rsc)
164    {
165       return null;
166    }
167
168    public CallableStatement JavaDoc prepareCall(String JavaDoc sql, String JavaDoc[] rst)
169    {
170       return null;
171    }
172
173    public CallableStatement JavaDoc prepareCall(String JavaDoc sql, int rst, int rsc, int i)
174    {
175       return null;
176    }
177
178    public PreparedStatement JavaDoc prepareStatement(String JavaDoc sql)
179    {
180       return new TestPreparedStatement(driver);
181    }
182
183    public PreparedStatement JavaDoc prepareStatement(String JavaDoc sql, int rst, int rsc)
184    {
185       return new TestPreparedStatement(driver);
186    }
187
188    public PreparedStatement JavaDoc prepareStatement(String JavaDoc sql, int rst)
189    {
190       return null;
191    }
192
193    public PreparedStatement JavaDoc prepareStatement(String JavaDoc sql, int[] rst)
194    {
195       return null;
196    }
197
198    public PreparedStatement JavaDoc prepareStatement(String JavaDoc sql, String JavaDoc[] rst)
199    {
200       return null;
201    }
202
203    public PreparedStatement JavaDoc prepareStatement(String JavaDoc sql, int rst, int rsc, int i)
204    {
205       return null;
206    }
207
208    public void rollback()
209    {
210    }
211
212    public void setCatalog(String JavaDoc cat)
213    {
214    }
215
216    public void setReadOnly(boolean r0)
217    {
218    }
219
220    public void setTransactionIsolation(int level)
221    {
222    }
223
224    public void setTypeMap(Map JavaDoc map)
225    {
226    }
227
228    public void setHoldability(int h)
229    {
230    }
231
232    public int getHoldability()
233    {
234       return 0;
235    }
236
237    public Savepoint JavaDoc setSavepoint()
238    {
239       return null;
240    }
241
242    public Savepoint JavaDoc setSavepoint(String JavaDoc name)
243    {
244       return null;
245    }
246
247    public void rollback(Savepoint JavaDoc s)
248    {
249    }
250    public void commit(Savepoint JavaDoc s)
251    {
252    }
253
254    public void releaseSavepoint(Savepoint JavaDoc s)
255    {
256    }
257
258 }// TestConnection
259
Popular Tags