Source Code Cross Referenced for DSConnectionFilter.java in  » Database-ORM » Speedo_1.4.5 » org » objectweb » speedo » pm » jdo » lib » 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 ORM » Speedo_1.4.5 » org.objectweb.speedo.pm.jdo.lib 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * Speedo: an implementation of JDO compliant personality on top of JORM generic
003:         * I/O sub-system.
004:         * Copyright (C) 2001-2005 France Telecom R&D
005:         *
006:         * This library is free software; you can redistribute it and/or
007:         * modify it under the terms of the GNU Lesser General Public
008:         * License as published by the Free Software Foundation; either
009:         * version 2 of the License, or (at your option) any later version.
010:         *
011:         * This library is distributed in the hope that it will be useful,
012:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014:         * Lesser General Public License for more details.
015:         *
016:         * You should have received a copy of the GNU Lesser General Public
017:         * License along with this library; if not, write to the Free Software
018:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
019:         *
020:         *
021:         *
022:         * Contact: speedo@objectweb.org
023:         *
024:         * Authors: S. Chassande-Barrioz
025:         *
026:         */package org.objectweb.speedo.pm.jdo.lib;
027:
028:        import java.sql.CallableStatement;
029:        import java.sql.Connection;
030:        import java.sql.DatabaseMetaData;
031:        import java.sql.PreparedStatement;
032:        import java.sql.SQLException;
033:        import java.sql.SQLWarning;
034:        import java.sql.Savepoint;
035:        import java.sql.Statement;
036:        import java.util.Map;
037:
038:        import javax.jdo.JDOUserException;
039:
040:        /**
041:         * This class implements the java.sql.Connection and delegates call to an inner
042:         * connection. But some calls are forbidden by the JDO 2 specification (12.16).
043:         * 
044:         * @author S.Chassande-Barrioz
045:         */
046:        public class DSConnectionFilter implements  Connection {
047:
048:            Connection inner;
049:
050:            /**
051:             * indicates if the inner connection must be closed or simply forgotten.
052:             */
053:            boolean reallyClose;
054:
055:            /**
056:             * @param inner
057:             * @param reallyClose
058:             */
059:            public DSConnectionFilter(Object inner, boolean reallyClose) {
060:                super ();
061:                this .inner = (Connection) inner;
062:                this .reallyClose = reallyClose;
063:            }
064:
065:            public void clearWarnings() throws SQLException {
066:                throw new JDOUserException("Action forbidden on JDO connection");
067:            }
068:
069:            public void close() throws SQLException {
070:                if (reallyClose) {
071:                    inner.close();
072:                }
073:                inner = null;
074:            }
075:
076:            public void commit() throws SQLException {
077:                throw new JDOUserException("Action forbidden on JDO connection");
078:            }
079:
080:            public Statement createStatement() throws SQLException {
081:                return inner.createStatement();
082:            }
083:
084:            public Statement createStatement(int resultSetType,
085:                    int resultSetConcurrency, int resultSetHoldability)
086:                    throws SQLException {
087:                return inner.createStatement(resultSetType,
088:                        resultSetConcurrency, resultSetHoldability);
089:            }
090:
091:            public Statement createStatement(int resultSetType,
092:                    int resultSetConcurrency) throws SQLException {
093:                return inner.createStatement(resultSetType,
094:                        resultSetConcurrency);
095:            }
096:
097:            public boolean getAutoCommit() throws SQLException {
098:                return inner.getAutoCommit();
099:            }
100:
101:            public String getCatalog() throws SQLException {
102:                return inner.getCatalog();
103:            }
104:
105:            public int getHoldability() throws SQLException {
106:                return inner.getHoldability();
107:            }
108:
109:            public DatabaseMetaData getMetaData() throws SQLException {
110:                throw new JDOUserException("Action forbidden on JDO connection");
111:            }
112:
113:            public int getTransactionIsolation() throws SQLException {
114:                return inner.getTransactionIsolation();
115:            }
116:
117:            public Map getTypeMap() throws SQLException {
118:                return inner.getTypeMap();
119:            }
120:
121:            public SQLWarning getWarnings() throws SQLException {
122:                return inner.getWarnings();
123:            }
124:
125:            public boolean isClosed() throws SQLException {
126:                return inner.isClosed();
127:            }
128:
129:            public boolean isReadOnly() throws SQLException {
130:                return inner.isReadOnly();
131:            }
132:
133:            public String nativeSQL(String sql) throws SQLException {
134:                return inner.nativeSQL(sql);
135:            }
136:
137:            public CallableStatement prepareCall(String sql, int resultSetType,
138:                    int resultSetConcurrency, int resultSetHoldability)
139:                    throws SQLException {
140:                return inner.prepareCall(sql, resultSetType,
141:                        resultSetConcurrency, resultSetHoldability);
142:            }
143:
144:            public CallableStatement prepareCall(String sql, int resultSetType,
145:                    int resultSetConcurrency) throws SQLException {
146:                return inner.prepareCall(sql, resultSetType,
147:                        resultSetConcurrency);
148:            }
149:
150:            public CallableStatement prepareCall(String sql)
151:                    throws SQLException {
152:                return inner.prepareCall(sql);
153:            }
154:
155:            public PreparedStatement prepareStatement(String sql,
156:                    int resultSetType, int resultSetConcurrency,
157:                    int resultSetHoldability) throws SQLException {
158:                return inner.prepareStatement(sql, resultSetType,
159:                        resultSetConcurrency, resultSetHoldability);
160:            }
161:
162:            public PreparedStatement prepareStatement(String sql,
163:                    int resultSetType, int resultSetConcurrency)
164:                    throws SQLException {
165:                return inner.prepareStatement(sql, resultSetType,
166:                        resultSetConcurrency);
167:            }
168:
169:            public PreparedStatement prepareStatement(String sql,
170:                    int autoGeneratedKeys) throws SQLException {
171:                return inner.prepareStatement(sql, autoGeneratedKeys);
172:            }
173:
174:            public PreparedStatement prepareStatement(String sql,
175:                    int[] columnIndexes) throws SQLException {
176:                return inner.prepareStatement(sql, columnIndexes);
177:            }
178:
179:            public PreparedStatement prepareStatement(String sql,
180:                    String[] columnNames) throws SQLException {
181:                return inner.prepareStatement(sql, columnNames);
182:            }
183:
184:            public PreparedStatement prepareStatement(String sql)
185:                    throws SQLException {
186:                return inner.prepareStatement(sql);
187:            }
188:
189:            public void releaseSavepoint(Savepoint savepoint)
190:                    throws SQLException {
191:                throw new JDOUserException("Action forbidden on JDO connection");
192:            }
193:
194:            public void rollback() throws SQLException {
195:                throw new JDOUserException("Action forbidden on JDO connection");
196:            }
197:
198:            public void rollback(Savepoint savepoint) throws SQLException {
199:                throw new JDOUserException("Action forbidden on JDO connection");
200:            }
201:
202:            public void setAutoCommit(boolean autoCommit) throws SQLException {
203:                throw new JDOUserException("Action forbidden on JDO connection");
204:            }
205:
206:            public void setCatalog(String catalog) throws SQLException {
207:                throw new JDOUserException("Action forbidden on JDO connection");
208:            }
209:
210:            public void setHoldability(int holdability) throws SQLException {
211:                throw new JDOUserException("Action forbidden on JDO connection");
212:            }
213:
214:            public void setReadOnly(boolean readOnly) throws SQLException {
215:                throw new JDOUserException("Action forbidden on JDO connection");
216:            }
217:
218:            public Savepoint setSavepoint() throws SQLException {
219:                throw new JDOUserException("Action forbidden on JDO connection");
220:            }
221:
222:            public Savepoint setSavepoint(String name) throws SQLException {
223:                throw new JDOUserException("Action forbidden on JDO connection");
224:            }
225:
226:            public void setTransactionIsolation(int level) throws SQLException {
227:                throw new JDOUserException("Action forbidden on JDO connection");
228:            }
229:
230:            public void setTypeMap(Map map) throws SQLException {
231:                throw new JDOUserException("Action forbidden on JDO connection");
232:            }
233:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.