Source Code Cross Referenced for TesterPreparedStatement.java in  » Database-JDBC-Connection-Pool » Connection-Pool-DBCP » org » apache » commons » dbcp » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database JDBC Connection Pool » Connection Pool DBCP » org.apache.commons.dbcp 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


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:         */
017:
018:        package org.apache.commons.dbcp;
019:
020:        import java.math.BigDecimal;
021:        import java.sql.Array;
022:        import java.sql.Blob;
023:        import java.sql.Clob;
024:        import java.sql.Connection;
025:        import java.sql.PreparedStatement;
026:        import java.sql.Ref;
027:        import java.sql.ResultSet;
028:        import java.sql.ResultSetMetaData;
029:        import java.sql.SQLException;
030:        import java.util.Calendar;
031:
032:        /**
033:         * A dummy {@link PreparedStatement}, for testing purposes.
034:         * 
035:         * @author Rodney Waldhoff
036:         * @author Dirk Verbeeck
037:         * @version $Revision: 479137 $ $Date: 2006-11-25 08:51:48 -0700 (Sat, 25 Nov 2006) $
038:         */
039:        public class TesterPreparedStatement extends TesterStatement implements 
040:                PreparedStatement {
041:            private ResultSetMetaData _resultSetMetaData = null;
042:            private String _sql = null;
043:            private String _catalog = null;
044:
045:            public TesterPreparedStatement(Connection conn) {
046:                super (conn);
047:                try {
048:                    _catalog = conn.getCatalog();
049:                } catch (SQLException e) {
050:                }
051:            }
052:
053:            public TesterPreparedStatement(Connection conn, String sql) {
054:                super (conn);
055:                _sql = sql;
056:                try {
057:                    _catalog = conn.getCatalog();
058:                } catch (SQLException e) {
059:                }
060:            }
061:
062:            public TesterPreparedStatement(Connection conn, String sql,
063:                    int resultSetType, int resultSetConcurrency) {
064:                super (conn, resultSetType, resultSetConcurrency);
065:                _sql = sql;
066:                try {
067:                    _catalog = conn.getCatalog();
068:                } catch (SQLException e) {
069:                }
070:            }
071:
072:            /** for junit test only */
073:            public String getCatalog() {
074:                return _catalog;
075:            }
076:
077:            public ResultSet executeQuery(String sql) throws SQLException {
078:                checkOpen();
079:                if ("null".equals(sql)) {
080:                    return null;
081:                } else {
082:                    return new TesterResultSet(this , null, _resultSetType,
083:                            _resultSetConcurrency);
084:                }
085:            }
086:
087:            public int executeUpdate(String sql) throws SQLException {
088:                checkOpen();
089:                return _rowsUpdated;
090:            }
091:
092:            public ResultSet executeQuery() throws SQLException {
093:                checkOpen();
094:                if ("null".equals(_sql)) {
095:                    return null;
096:                } else {
097:                    return new TesterResultSet(this , null, _resultSetType,
098:                            _resultSetConcurrency);
099:                }
100:            }
101:
102:            public int executeUpdate() throws SQLException {
103:                checkOpen();
104:                return _rowsUpdated;
105:            }
106:
107:            public void setNull(int parameterIndex, int sqlType)
108:                    throws SQLException {
109:                checkOpen();
110:            }
111:
112:            public void setBoolean(int parameterIndex, boolean x)
113:                    throws SQLException {
114:                checkOpen();
115:            }
116:
117:            public void setByte(int parameterIndex, byte x) throws SQLException {
118:                checkOpen();
119:            }
120:
121:            public void setShort(int parameterIndex, short x)
122:                    throws SQLException {
123:                checkOpen();
124:            }
125:
126:            public void setInt(int parameterIndex, int x) throws SQLException {
127:                checkOpen();
128:            }
129:
130:            public void setLong(int parameterIndex, long x) throws SQLException {
131:                checkOpen();
132:            }
133:
134:            public void setFloat(int parameterIndex, float x)
135:                    throws SQLException {
136:                checkOpen();
137:            }
138:
139:            public void setDouble(int parameterIndex, double x)
140:                    throws SQLException {
141:                checkOpen();
142:            }
143:
144:            public void setBigDecimal(int parameterIndex, BigDecimal x)
145:                    throws SQLException {
146:                checkOpen();
147:            }
148:
149:            public void setString(int parameterIndex, String x)
150:                    throws SQLException {
151:                checkOpen();
152:            }
153:
154:            public void setBytes(int parameterIndex, byte x[])
155:                    throws SQLException {
156:                checkOpen();
157:            }
158:
159:            public void setDate(int parameterIndex, java.sql.Date x)
160:                    throws SQLException {
161:                checkOpen();
162:            }
163:
164:            public void setTime(int parameterIndex, java.sql.Time x)
165:                    throws SQLException {
166:                checkOpen();
167:            }
168:
169:            public void setTimestamp(int parameterIndex, java.sql.Timestamp x)
170:                    throws SQLException {
171:                checkOpen();
172:            }
173:
174:            public void setAsciiStream(int parameterIndex,
175:                    java.io.InputStream x, int length) throws SQLException {
176:                checkOpen();
177:            }
178:
179:            /** @deprecated */
180:            public void setUnicodeStream(int parameterIndex,
181:                    java.io.InputStream x, int length) throws SQLException {
182:                checkOpen();
183:            }
184:
185:            public void setBinaryStream(int parameterIndex,
186:                    java.io.InputStream x, int length) throws SQLException {
187:                checkOpen();
188:            }
189:
190:            public void clearParameters() throws SQLException {
191:                checkOpen();
192:            }
193:
194:            public void setObject(int parameterIndex, Object x,
195:                    int targetSqlType, int scale) throws SQLException {
196:                checkOpen();
197:            }
198:
199:            public void setObject(int parameterIndex, Object x,
200:                    int targetSqlType) throws SQLException {
201:                checkOpen();
202:            }
203:
204:            public void setObject(int parameterIndex, Object x)
205:                    throws SQLException {
206:                checkOpen();
207:            }
208:
209:            public boolean execute() throws SQLException {
210:                checkOpen();
211:                return true;
212:            }
213:
214:            public void addBatch() throws SQLException {
215:                checkOpen();
216:            }
217:
218:            public void setCharacterStream(int parameterIndex,
219:                    java.io.Reader reader, int length) throws SQLException {
220:                checkOpen();
221:            }
222:
223:            public void setRef(int i, Ref x) throws SQLException {
224:                checkOpen();
225:            }
226:
227:            public void setBlob(int i, Blob x) throws SQLException {
228:                checkOpen();
229:            }
230:
231:            public void setClob(int i, Clob x) throws SQLException {
232:                checkOpen();
233:            }
234:
235:            public void setArray(int i, Array x) throws SQLException {
236:                checkOpen();
237:            }
238:
239:            public ResultSetMetaData getMetaData() throws SQLException {
240:                checkOpen();
241:                return _resultSetMetaData;
242:            }
243:
244:            public void setDate(int parameterIndex, java.sql.Date x,
245:                    Calendar cal) throws SQLException {
246:                checkOpen();
247:            }
248:
249:            public void setTime(int parameterIndex, java.sql.Time x,
250:                    Calendar cal) throws SQLException {
251:                checkOpen();
252:            }
253:
254:            public void setTimestamp(int parameterIndex, java.sql.Timestamp x,
255:                    Calendar cal) throws SQLException {
256:                checkOpen();
257:            }
258:
259:            public void setNull(int paramIndex, int sqlType, String typeName)
260:                    throws SQLException {
261:                checkOpen();
262:            }
263:
264:            // ------------------- JDBC 3.0 -----------------------------------------
265:            // Will be commented by the build process on a JDBC 2.0 system
266:
267:            /* JDBC_3_ANT_KEY_BEGIN */
268:
269:            public boolean getMoreResults(int current) throws SQLException {
270:                throw new SQLException("Not implemented.");
271:            }
272:
273:            public ResultSet getGeneratedKeys() throws SQLException {
274:                throw new SQLException("Not implemented.");
275:            }
276:
277:            public int executeUpdate(String sql, int autoGeneratedKeys)
278:                    throws SQLException {
279:                throw new SQLException("Not implemented.");
280:            }
281:
282:            public int executeUpdate(String sql, int columnIndexes[])
283:                    throws SQLException {
284:                throw new SQLException("Not implemented.");
285:            }
286:
287:            public int executeUpdate(String sql, String columnNames[])
288:                    throws SQLException {
289:                throw new SQLException("Not implemented.");
290:            }
291:
292:            public boolean execute(String sql, int autoGeneratedKeys)
293:                    throws SQLException {
294:                throw new SQLException("Not implemented.");
295:            }
296:
297:            public boolean execute(String sl, int columnIndexes[])
298:                    throws SQLException {
299:                throw new SQLException("Not implemented.");
300:            }
301:
302:            public boolean execute(String sql, String columnNames[])
303:                    throws SQLException {
304:                throw new SQLException("Not implemented.");
305:            }
306:
307:            public int getResultSetHoldability() throws SQLException {
308:                throw new SQLException("Not implemented.");
309:            }
310:
311:            public void setURL(int parameterIndex, java.net.URL x)
312:                    throws SQLException {
313:                throw new SQLException("Not implemented.");
314:            }
315:
316:            public java.sql.ParameterMetaData getParameterMetaData()
317:                    throws SQLException {
318:                throw new SQLException("Not implemented.");
319:            }
320:
321:            /* JDBC_3_ANT_KEY_END */
322:
323:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.