Source Code Cross Referenced for VersantClientJDBCConnection.java in  » Testing » PolePosition-0.20 » com » versant » core » jdbc » 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 » Testing » PolePosition 0.20 » com.versant.core.jdbc 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (c) 1998 - 2005 Versant Corporation
003:         * All rights reserved. This program and the accompanying materials
004:         * are made available under the terms of the Eclipse Public License v1.0
005:         * which accompanies this distribution, and is available at
006:         * http://www.eclipse.org/legal/epl-v10.html
007:         *
008:         * Contributors:
009:         * Versant Corporation - initial API and implementation
010:         */
011:        package com.versant.core.jdbc;
012:
013:        import com.versant.core.common.BindingSupportImpl;
014:
015:        import java.sql.*;
016:
017:        /**
018:         * This is a JDBC Connection proxy for local PersistenceManager use. It is
019:         * wrapped by this proxy so that we can disconnect the client and the pooled
020:         * connection if he misbehaves.
021:         */
022:        public final class VersantClientJDBCConnection implements  Connection {
023:
024:            private JdbcStorageManager owner;
025:            private Connection realConnection;
026:
027:            public VersantClientJDBCConnection(JdbcStorageManager owner,
028:                    Connection realConnection) {
029:                this .owner = owner;
030:                this .realConnection = realConnection;
031:            }
032:
033:            public Connection getRealConnection() {
034:                return realConnection;
035:            }
036:
037:            private void checkClosed() {
038:                if (realConnection == null) {
039:                    throw BindingSupportImpl.getInstance().invalidOperation(
040:                            "The connection has been closed");
041:                }
042:            }
043:
044:            public Statement createStatement() throws SQLException {
045:                checkClosed();
046:                return realConnection.createStatement();
047:            }
048:
049:            public PreparedStatement prepareStatement(String sql)
050:                    throws SQLException {
051:                checkClosed();
052:                return realConnection.prepareStatement(sql);
053:            }
054:
055:            public CallableStatement prepareCall(String sql)
056:                    throws SQLException {
057:                checkClosed();
058:                return realConnection.prepareCall(sql);
059:            }
060:
061:            public String nativeSQL(String sql) throws SQLException {
062:                checkClosed();
063:                return realConnection.nativeSQL(sql);
064:            }
065:
066:            public void setAutoCommit(boolean autoCommit) {
067:                checkClosed();
068:                throw BindingSupportImpl
069:                        .getInstance()
070:                        .invalidOperation(
071:                                "This is not allowed. This connection is managed by JDO.");
072:            }
073:
074:            public boolean getAutoCommit() throws SQLException {
075:                checkClosed();
076:                return realConnection.getAutoCommit();
077:            }
078:
079:            public void commit() {
080:                checkClosed();
081:                throw BindingSupportImpl
082:                        .getInstance()
083:                        .invalidOperation(
084:                                "This is not allowed. Commit must be done via PersistenceManager.");
085:            }
086:
087:            public void rollback() {
088:                checkClosed();
089:                throw BindingSupportImpl
090:                        .getInstance()
091:                        .invalidOperation(
092:                                "This is not allowed. Rollback must be done via PersistenceManager.");
093:            }
094:
095:            public void close() throws SQLException {
096:                if (isClosed())
097:                    return;
098:                closeImp();
099:            }
100:
101:            public void closeImp() {
102:                realConnection = null;
103:                owner.clientConClosed();
104:            }
105:
106:            public boolean isClosed() throws SQLException {
107:                return realConnection == null || realConnection.isClosed();
108:            }
109:
110:            public DatabaseMetaData getMetaData() throws SQLException {
111:                checkClosed();
112:                return realConnection.getMetaData();
113:            }
114:
115:            public void setReadOnly(boolean readOnly) throws SQLException {
116:                checkClosed();
117:                realConnection.setReadOnly(readOnly);
118:            }
119:
120:            public boolean isReadOnly() throws SQLException {
121:                checkClosed();
122:                return realConnection.isReadOnly();
123:            }
124:
125:            public void setCatalog(String catalog) throws SQLException {
126:                checkClosed();
127:                realConnection.setCatalog(catalog);
128:            }
129:
130:            public String getCatalog() throws SQLException {
131:                checkClosed();
132:                return realConnection.getCatalog();
133:            }
134:
135:            public void setTransactionIsolation(int level) throws SQLException {
136:                checkClosed();
137:                realConnection.setTransactionIsolation(level);
138:            }
139:
140:            public int getTransactionIsolation() throws SQLException {
141:                checkClosed();
142:                return realConnection.getTransactionIsolation();
143:            }
144:
145:            public SQLWarning getWarnings() throws SQLException {
146:                checkClosed();
147:                return realConnection.getWarnings();
148:            }
149:
150:            public void clearWarnings() throws SQLException {
151:                checkClosed();
152:                realConnection.clearWarnings();
153:            }
154:
155:            public Statement createStatement(int resultSetType,
156:                    int resultSetConcurrency) throws SQLException {
157:                checkClosed();
158:                return realConnection.createStatement(resultSetType,
159:                        resultSetConcurrency);
160:            }
161:
162:            public PreparedStatement prepareStatement(String sql,
163:                    int resultSetType, int resultSetConcurrency)
164:                    throws SQLException {
165:                checkClosed();
166:                return realConnection.prepareStatement(sql, resultSetType,
167:                        resultSetConcurrency);
168:            }
169:
170:            public CallableStatement prepareCall(String sql, int resultSetType,
171:                    int resultSetConcurrency) throws SQLException {
172:                checkClosed();
173:                return realConnection.prepareCall(sql, resultSetType,
174:                        resultSetConcurrency);
175:            }
176:
177:            public java.util.Map getTypeMap() throws SQLException {
178:                checkClosed();
179:                return realConnection.getTypeMap();
180:            }
181:
182:            public void setTypeMap(java.util.Map map) throws SQLException {
183:                checkClosed();
184:                realConnection.setTypeMap(map);
185:            }
186:
187:            public void setHoldability(int holdability) throws SQLException {
188:                checkClosed();
189:                realConnection.setHoldability(holdability);
190:            }
191:
192:            public int getHoldability() throws SQLException {
193:                checkClosed();
194:                return realConnection.getHoldability();
195:            }
196:
197:            public Savepoint setSavepoint() throws SQLException {
198:                checkClosed();
199:                return realConnection.setSavepoint();
200:            }
201:
202:            public Savepoint setSavepoint(String name) throws SQLException {
203:                checkClosed();
204:                return realConnection.setSavepoint(name);
205:            }
206:
207:            public void rollback(Savepoint savepoint) throws SQLException {
208:                checkClosed();
209:                realConnection.rollback(savepoint);
210:            }
211:
212:            public void releaseSavepoint(Savepoint savepoint)
213:                    throws SQLException {
214:                checkClosed();
215:                realConnection.releaseSavepoint(savepoint);
216:            }
217:
218:            public Statement createStatement(int resultSetType,
219:                    int resultSetConcurrency, int resultSetHoldability)
220:                    throws SQLException {
221:                checkClosed();
222:                return realConnection.createStatement(resultSetType,
223:                        resultSetConcurrency, resultSetHoldability);
224:            }
225:
226:            public PreparedStatement prepareStatement(String sql,
227:                    int resultSetType, int resultSetConcurrency,
228:                    int resultSetHoldability) throws SQLException {
229:                checkClosed();
230:                return realConnection.prepareStatement(sql, resultSetType,
231:                        resultSetConcurrency, resultSetHoldability);
232:            }
233:
234:            public CallableStatement prepareCall(String sql, int resultSetType,
235:                    int resultSetConcurrency, int resultSetHoldability)
236:                    throws SQLException {
237:                checkClosed();
238:                return realConnection.prepareCall(sql, resultSetType,
239:                        resultSetConcurrency, resultSetHoldability);
240:            }
241:
242:            public PreparedStatement prepareStatement(String sql,
243:                    int autoGeneratedKeys) throws SQLException {
244:                checkClosed();
245:                return realConnection.prepareStatement(sql, autoGeneratedKeys);
246:            }
247:
248:            public PreparedStatement prepareStatement(String sql,
249:                    int columnIndexes[]) throws SQLException {
250:                checkClosed();
251:                return realConnection.prepareStatement(sql, columnIndexes);
252:            }
253:
254:            public PreparedStatement prepareStatement(String sql,
255:                    String columnNames[]) throws SQLException {
256:                checkClosed();
257:                return realConnection.prepareStatement(sql, columnNames);
258:            }
259:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.