1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45 package org.melati.poem.dbms.test.sql;
46
47 import java.sql.Array;
48 import java.sql.Blob;
49 import java.sql.Clob;
50 import java.sql.Connection;
51 import java.sql.NClob;
52 import java.sql.SQLClientInfoException;
53 import java.sql.SQLException;
54 import java.sql.SQLXML;
55 import java.sql.Struct;
56 import java.util.Properties;
57
58
59
60
61
62
63
64
65 public abstract class ThrowingConnectionJdbc4
66 extends ThrowingConnectionJdbc3
67 implements Connection {
68
69
70
71
72
73
74
75
76
77
78 public Array createArrayOf(String typeName, Object[] elements)
79 throws SQLException {
80 if (shouldThrow(this.getClass().getInterfaces()[0], "createArrayOf"))
81 throw new SQLException("Connection bombed");
82 return new ThrowingArray(it.createArrayOf(typeName, elements));
83 }
84
85
86
87
88
89 public Blob createBlob() throws SQLException {
90 if (shouldThrow(this.getClass().getInterfaces()[0], "createBlob"))
91 throw new SQLException("Connection bombed");
92 return new ThrowingBlob(it.createBlob());
93 }
94
95
96
97
98
99 public Clob createClob() throws SQLException {
100 if (shouldThrow(this.getClass().getInterfaces()[0], "createClob"))
101 throw new SQLException("Connection bombed");
102 return new ThrowingClob(it.createClob());
103 }
104
105
106
107
108
109 public NClob createNClob() throws SQLException {
110 if (shouldThrow(this.getClass().getInterfaces()[0], "createNClob"))
111 throw new SQLException("Connection bombed");
112 return new ThrowingNClob(it.createNClob());
113 }
114
115
116
117
118
119 public SQLXML createSQLXML() throws SQLException {
120 if (shouldThrow(this.getClass().getInterfaces()[0], "createSQLXML"))
121 throw new SQLException("Connection bombed");
122 return new ThrowingSQLXML(it.createSQLXML());
123 }
124
125
126
127
128
129 public Struct createStruct(String typeName, Object[] attributes)
130 throws SQLException {
131 if (shouldThrow(this.getClass().getInterfaces()[0], "createStruct"))
132 throw new SQLException("Connection bombed");
133 return new ThrowingStruct(it.createStruct(typeName, attributes));
134 }
135
136
137
138
139
140 public Properties getClientInfo() throws SQLException {
141 if (shouldThrow(this.getClass().getInterfaces()[0], "getClientInfo"))
142 throw new SQLException("Connection bombed");
143 return it.getClientInfo();
144 }
145
146
147
148
149
150 public String getClientInfo(String name) throws SQLException {
151 if (shouldThrow(this.getClass().getInterfaces()[0], "getClientInfo"))
152 throw new SQLException("Connection bombed");
153 return it.getClientInfo(name);
154 }
155
156
157
158
159
160 public boolean isValid(int timeout) throws SQLException {
161 if (shouldThrow(this.getClass().getInterfaces()[0], "isValid"))
162 throw new SQLException("Connection bombed");
163 return it.isValid(timeout);
164 }
165
166
167
168
169
170 public void setClientInfo(Properties properties)
171 throws SQLClientInfoException {
172 if (shouldThrow(this.getClass().getInterfaces()[0], "setClientInfo"))
173 throw new SQLClientInfoException();
174 it.setClientInfo(properties);
175 }
176
177
178
179
180
181 public void setClientInfo(String name, String value)
182 throws SQLClientInfoException {
183 if (shouldThrow(this.getClass().getInterfaces()[0], "setClientInfo"))
184 throw new SQLClientInfoException();
185 it.setClientInfo(name, value);
186 }
187
188
189
190
191
192 public boolean isWrapperFor(Class<?> iface) throws SQLException {
193 if (shouldThrow(this.getClass().getInterfaces()[0], "isWrapperFor"))
194 throw new SQLException("Connection bombed");
195 return it.isWrapperFor(iface);
196 }
197
198
199
200
201
202 public <T> T unwrap(Class<T> iface) throws SQLException {
203 if (shouldThrow(this.getClass().getInterfaces()[0], "unwrap"))
204 throw new SQLException("Connection bombed");
205 return it.unwrap(iface);
206 }
207
208
209
210 }