Source Code Cross Referenced for SequoiaJDBCRegExp.java in  » Database-JDBC-Connection-Pool » sequoia-2.10.9 » org » continuent » sequoia » driver » 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 » sequoia 2.10.9 » org.continuent.sequoia.driver 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * Sequoia: Database clustering technology.
003:         * Copyright (C) 2005 AmicoSoft, Inc. dba Emic Networks
004:         * Contact: sequoia@continuent.org
005:         * 
006:         * Licensed under the Apache License, Version 2.0 (the "License");
007:         * you may not use this file except in compliance with the License.
008:         * You may obtain a copy of the License at
009:         * 
010:         * http://www.apache.org/licenses/LICENSE-2.0
011:         * 
012:         * Unless required by applicable law or agreed to in writing, software
013:         * distributed under the License is distributed on an "AS IS" BASIS,
014:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015:         * See the License for the specific language governing permissions and
016:         * limitations under the License. 
017:         *
018:         * Initial developer(s): Emmanuel Cecchet.
019:         * Contributor(s): ______________________.
020:         */package org.continuent.sequoia.driver;
021:
022:        import java.util.regex.Pattern;
023:
024:        /**
025:         * This class defines the regular expressions to map generic ANSI SQL requests
026:         * to JDBC API calls.
027:         * 
028:         * @author <a href="mailto:emmanuel.cecchet@continuent.com">Emmanuel Cecchet</a>
029:         * @version 1.0
030:         */
031:        public final class SequoiaJDBCRegExp implements  JDBCRegExp {
032:            /** Regexp patterns for Statement class */
033:            private static final String BEGIN_PATTERN_STRING = "^begin.*";
034:            private static final String COMMIT_PATTERN_STRING = "^commit.*";
035:            private static final String RELEASE_SAVEPOINT_PATTERN_STRING = "^release\\s+savepoint.*";
036:            private static final String ROLLBACK_PATTERN_STRING = "^rollback.*";
037:            private static final String ROLLBACK_TO_SAVEPOINT_PATTERN_STRING = "^rollback\\s+to\\s+.*";
038:            private static final String SET_ISOLATION_LEVEL_PATTERN_STRING = "^set.*transaction.*isolation\\s+level.*";
039:            private static final String SET_READ_ONLY_TRANSACTION_PATTERN_STRING = "^set.*transaction\\s+read\\s+only.*";
040:            private static final String SET_SAVEPOINT_PATTERN_STRING = "^savepoint.*";
041:            private static final String SET_AUTOCOMMIT_1_PATTERN_STRING = "";
042:
043:            // Note that we use Patterns and not Matchers because these objects are
044:            // potentially accessed concurrently and parsing could occur in parallel. This
045:            // way, each caller will have to call Pattern.matcher() that will allocate a
046:            // matcher for its own use in a thread-safe way.
047:
048:            private static final Pattern BEGIN_PATTERN = Pattern.compile(
049:                    BEGIN_PATTERN_STRING, Pattern.CASE_INSENSITIVE
050:                            | Pattern.DOTALL);
051:
052:            private static final Pattern COMMIT_PATTERN = Pattern.compile(
053:                    COMMIT_PATTERN_STRING, Pattern.CASE_INSENSITIVE
054:                            | Pattern.DOTALL);
055:
056:            private static final Pattern RELEASE_SAVEPOINT_PATTERN = Pattern
057:                    .compile(RELEASE_SAVEPOINT_PATTERN_STRING,
058:                            Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
059:
060:            private static final Pattern ROLLBACK_PATTERN = Pattern.compile(
061:                    ROLLBACK_PATTERN_STRING, Pattern.CASE_INSENSITIVE
062:                            | Pattern.DOTALL);
063:
064:            private static final Pattern ROLLBACK_TO_SAVEPOINT_PATTERN = Pattern
065:                    .compile(ROLLBACK_TO_SAVEPOINT_PATTERN_STRING,
066:                            Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
067:
068:            private static final Pattern SET_ISOLATION_LEVEL_PATTERN = Pattern
069:                    .compile(SET_ISOLATION_LEVEL_PATTERN_STRING,
070:                            Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
071:
072:            private static final Pattern SET_READ_ONLY_TRANSACTION_PATTERN = Pattern
073:                    .compile(SET_READ_ONLY_TRANSACTION_PATTERN_STRING,
074:                            Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
075:
076:            private static final Pattern SET_SAVEPOINT_PATTERN = Pattern
077:                    .compile(SET_SAVEPOINT_PATTERN_STRING,
078:                            Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
079:            private static final Pattern SET_AUTOCOMMIT_1_PATTERN = Pattern
080:                    .compile(SET_AUTOCOMMIT_1_PATTERN_STRING,
081:                            Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
082:
083:            /**
084:             * @see org.continuent.sequoia.driver.JDBCRegExp#getBeginPattern()
085:             */
086:            public Pattern getBeginPattern() {
087:                return BEGIN_PATTERN;
088:            }
089:
090:            /**
091:             * @see org.continuent.sequoia.driver.JDBCRegExp#getCommitPattern()
092:             */
093:            public Pattern getCommitPattern() {
094:                return COMMIT_PATTERN;
095:            }
096:
097:            /**
098:             * @see org.continuent.sequoia.driver.JDBCRegExp#getReleaseSavepointPattern()
099:             */
100:            public Pattern getReleaseSavepointPattern() {
101:                return RELEASE_SAVEPOINT_PATTERN;
102:            }
103:
104:            /**
105:             * @see org.continuent.sequoia.driver.JDBCRegExp#getRollbackPattern()
106:             */
107:            public Pattern getRollbackPattern() {
108:                return ROLLBACK_PATTERN;
109:            }
110:
111:            /**
112:             * @see org.continuent.sequoia.driver.JDBCRegExp#getRollbackToSavepointPattern()
113:             */
114:            public Pattern getRollbackToSavepointPattern() {
115:                return ROLLBACK_TO_SAVEPOINT_PATTERN;
116:            }
117:
118:            /**
119:             * @see org.continuent.sequoia.driver.JDBCRegExp#getSetIsolationLevelPattern()
120:             */
121:            public Pattern getSetIsolationLevelPattern() {
122:                return SET_ISOLATION_LEVEL_PATTERN;
123:            }
124:
125:            /**
126:             * @see org.continuent.sequoia.driver.JDBCRegExp#getSetReadOnlyTransactionPattern()
127:             */
128:            public Pattern getSetReadOnlyTransactionPattern() {
129:                return SET_READ_ONLY_TRANSACTION_PATTERN;
130:            }
131:
132:            /**
133:             * @see org.continuent.sequoia.driver.JDBCRegExp#getSetSavepointPattern()
134:             */
135:            public Pattern getSetSavepointPattern() {
136:                return SET_SAVEPOINT_PATTERN;
137:            }
138:
139:            /**
140:             * @see org.continuent.sequoia.driver.JDBCRegExp#getSetAutocommitPattern()
141:             */
142:            public Pattern getSetAutocommit1Pattern() {
143:                return SET_AUTOCOMMIT_1_PATTERN;
144:            }
145:
146:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.