Source Code Cross Referenced for SmartStatement.java in  » Database-JDBC-Connection-Pool » SmartPool » org » smartlib » pool » core » 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 » SmartPool » org.smartlib.pool.core 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * @(#) SmartStatement 1.0 02/08/01
003:         */
004:
005:        package org.smartlib.pool.core;
006:
007:        import java.sql.*;
008:
009:        /**
010:         * This  class encapsulates a Statement.
011:         * Dont expect me to document this class, if you want refer Sun's Documentation.
012:         * 
013:         * @author	Sachin Shekar Shetty  
014:         * @version 1.0, 02/08/01
015:         */
016:
017:        public class SmartStatement implements  Statement, Close {
018:
019:            private Statement stmt;
020:            private boolean isClosed = false;
021:            private SmartConnection sConn;
022:            private Debugger debug = new Debugger("SmartStatement", true);
023:
024:            // default access
025:            SmartStatement(Statement stmt, SmartConnection sConn) {
026:
027:                this .stmt = stmt;
028:                this .sConn = sConn;
029:
030:            }
031:
032:            private void preProcess() throws SQLException {
033:
034:                if (isClosed())
035:                    throw new SQLException("Statement already closed");
036:                sConn.setLastAccessedTime();
037:
038:            }
039:
040:            public ResultSet executeQuery(String sql) throws SQLException {
041:
042:                preProcess();
043:                return stmt.executeQuery(sql);
044:
045:            }
046:
047:            public int executeUpdate(String sql) throws SQLException {
048:
049:                preProcess();
050:                return stmt.executeUpdate(sql);
051:
052:            }
053:
054:            public void close() throws SQLException {
055:
056:                if (isClosed)
057:                    throw new SQLException("Statement already closed");
058:                stmt.close();
059:                debug.print("Statement Closed for:" + sConn.getOwner());
060:                isClosed = true;
061:
062:            }
063:
064:            public boolean isClosed() throws SQLException {
065:
066:                return isClosed;
067:
068:            }
069:
070:            public int getMaxFieldSize() throws SQLException {
071:
072:                preProcess();
073:                return stmt.getMaxFieldSize();
074:
075:            }
076:
077:            public void setMaxFieldSize(int max) throws SQLException {
078:
079:                preProcess();
080:                stmt.setMaxFieldSize(max);
081:
082:            }
083:
084:            public int getMaxRows() throws SQLException {
085:
086:                preProcess();
087:                return stmt.getMaxRows();
088:
089:            }
090:
091:            public void setMaxRows(int max) throws SQLException {
092:
093:                preProcess();
094:                stmt.setMaxRows(max);
095:
096:            }
097:
098:            public void setEscapeProcessing(boolean enable) throws SQLException {
099:
100:                preProcess();
101:                stmt.setEscapeProcessing(enable);
102:
103:            }
104:
105:            public int getQueryTimeout() throws SQLException {
106:
107:                preProcess();
108:                return stmt.getQueryTimeout();
109:
110:            }
111:
112:            public void setQueryTimeout(int seconds) throws SQLException {
113:
114:                preProcess();
115:                stmt.setQueryTimeout(seconds);
116:
117:            }
118:
119:            public void cancel() throws SQLException {
120:
121:                preProcess();
122:                stmt.cancel();
123:
124:            }
125:
126:            public SQLWarning getWarnings() throws SQLException {
127:
128:                preProcess();
129:                return stmt.getWarnings();
130:
131:            }
132:
133:            public void clearWarnings() throws SQLException {
134:
135:                preProcess();
136:                stmt.clearWarnings();
137:
138:            }
139:
140:            public void setCursorName(String name) throws SQLException {
141:
142:                preProcess();
143:                stmt.setCursorName(name);
144:
145:            }
146:
147:            public boolean execute(String sql) throws SQLException {
148:
149:                preProcess();
150:                return stmt.execute(sql);
151:
152:            }
153:
154:            public ResultSet getResultSet() throws SQLException {
155:
156:                preProcess();
157:                return stmt.getResultSet();
158:
159:            }
160:
161:            public int getUpdateCount() throws SQLException {
162:
163:                preProcess();
164:                return stmt.getUpdateCount();
165:
166:            }
167:
168:            public boolean getMoreResults() throws SQLException {
169:
170:                preProcess();
171:                return stmt.getMoreResults();
172:
173:            }
174:
175:            public void setFetchDirection(int direction) throws SQLException {
176:
177:                preProcess();
178:                stmt.setFetchDirection(direction);
179:
180:            }
181:
182:            public int getFetchDirection() throws SQLException {
183:
184:                preProcess();
185:                return stmt.getFetchDirection();
186:
187:            }
188:
189:            public void setFetchSize(int rows) throws SQLException {
190:
191:                preProcess();
192:                stmt.setFetchSize(rows);
193:
194:            }
195:
196:            public int getFetchSize() throws SQLException {
197:
198:                preProcess();
199:                return stmt.getFetchSize();
200:
201:            }
202:
203:            public int getResultSetConcurrency() throws SQLException {
204:
205:                preProcess();
206:                return stmt.getResultSetConcurrency();
207:
208:            }
209:
210:            public int getResultSetType() throws SQLException {
211:
212:                preProcess();
213:                return stmt.getResultSetType();
214:
215:            }
216:
217:            public void addBatch(String sql) throws SQLException {
218:
219:                preProcess();
220:                stmt.addBatch(sql);
221:
222:            }
223:
224:            public void clearBatch() throws SQLException {
225:
226:                preProcess();
227:                stmt.clearBatch();
228:
229:            }
230:
231:            public int[] executeBatch() throws SQLException {
232:
233:                preProcess();
234:                return stmt.executeBatch();
235:
236:            }
237:
238:            public Connection getConnection() throws SQLException {
239:
240:                preProcess();
241:                return stmt.getConnection();
242:
243:            }
244:
245:            public boolean getMoreResults(int current) throws SQLException {
246:                return false; //To change body of implemented methods use File | Settings | File Templates.
247:            }
248:
249:            public ResultSet getGeneratedKeys() throws SQLException {
250:                return null; //To change body of implemented methods use File | Settings | File Templates.
251:            }
252:
253:            public int executeUpdate(String sql, int autoGeneratedKeys)
254:                    throws SQLException {
255:                return 0; //To change body of implemented methods use File | Settings | File Templates.
256:            }
257:
258:            public int executeUpdate(String sql, int columnIndexes[])
259:                    throws SQLException {
260:                return 0; //To change body of implemented methods use File | Settings | File Templates.
261:            }
262:
263:            public int executeUpdate(String sql, String columnNames[])
264:                    throws SQLException {
265:                return 0; //To change body of implemented methods use File | Settings | File Templates.
266:            }
267:
268:            public boolean execute(String sql, int autoGeneratedKeys)
269:                    throws SQLException {
270:                return false; //To change body of implemented methods use File | Settings | File Templates.
271:            }
272:
273:            public boolean execute(String sql, int columnIndexes[])
274:                    throws SQLException {
275:                return false; //To change body of implemented methods use File | Settings | File Templates.
276:            }
277:
278:            public boolean execute(String sql, String columnNames[])
279:                    throws SQLException {
280:                return false; //To change body of implemented methods use File | Settings | File Templates.
281:            }
282:
283:            public int getResultSetHoldability() throws SQLException {
284:                return 0; //To change body of implemented methods use File | Settings | File Templates.
285:            }
286:
287:            public String toString() {
288:
289:                return stmt.toString();
290:
291:            }
292:
293:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.