Source Code Cross Referenced for SQLErrorCodes.java in  » J2EE » spring-framework-2.5 » org » springframework » jdbc » support » 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 » J2EE » spring framework 2.5 » org.springframework.jdbc.support 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2002-2007 the original author or authors.
003:         *
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         *      http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:
017:        package org.springframework.jdbc.support;
018:
019:        import org.springframework.util.StringUtils;
020:
021:        /**
022:         * JavaBean for holding JDBC error codes for a particular database.
023:         * Instances of this class are normally loaded through a bean factory.
024:         *
025:         * <p>Used by Spring's {@link SQLErrorCodeSQLExceptionTranslator}.
026:         * The file "sql-error-codes.xml" in this package contains default
027:         * <code>SQLErrorCodes</code> instances for various databases.
028:         *
029:         * @author Thomas Risberg
030:         * @author Juergen Hoeller
031:         * @see SQLErrorCodesFactory
032:         * @see SQLErrorCodeSQLExceptionTranslator
033:         */
034:        public class SQLErrorCodes {
035:
036:            private String[] databaseProductNames;
037:
038:            private boolean useSqlStateForTranslation = false;
039:
040:            private String[] badSqlGrammarCodes = new String[0];
041:
042:            private String[] invalidResultSetAccessCodes = new String[0];
043:
044:            private String[] dataAccessResourceFailureCodes = new String[0];
045:
046:            private String[] permissionDeniedCodes = new String[0];
047:
048:            private String[] dataIntegrityViolationCodes = new String[0];
049:
050:            private String[] cannotAcquireLockCodes = new String[0];
051:
052:            private String[] deadlockLoserCodes = new String[0];
053:
054:            private String[] cannotSerializeTransactionCodes = new String[0];
055:
056:            private CustomSQLErrorCodesTranslation[] customTranslations;
057:
058:            /**
059:             * Set this property if the database name contains spaces,
060:             * in which case we can not use the bean name for lookup.
061:             */
062:            public void setDatabaseProductName(String databaseProductName) {
063:                this .databaseProductNames = new String[] { databaseProductName };
064:            }
065:
066:            public String getDatabaseProductName() {
067:                return (this .databaseProductNames != null
068:                        && this .databaseProductNames.length > 0 ? this .databaseProductNames[0]
069:                        : null);
070:            }
071:
072:            /**
073:             * Set this property to specify multiple database names that contains spaces,
074:             * in which case we can not use bean names for lookup.
075:             */
076:            public void setDatabaseProductNames(String[] databaseProductNames) {
077:                this .databaseProductNames = databaseProductNames;
078:            }
079:
080:            public String[] getDatabaseProductNames() {
081:                return this .databaseProductNames;
082:            }
083:
084:            /**
085:             * Set this property to true for databases that do not provide an error code
086:             * but that do provide SQL State (this includes PostgreSQL).
087:             */
088:            public void setUseSqlStateForTranslation(
089:                    boolean useStateCodeForTranslation) {
090:                this .useSqlStateForTranslation = useStateCodeForTranslation;
091:            }
092:
093:            public boolean isUseSqlStateForTranslation() {
094:                return this .useSqlStateForTranslation;
095:            }
096:
097:            public void setBadSqlGrammarCodes(String[] badSqlGrammarCodes) {
098:                this .badSqlGrammarCodes = StringUtils
099:                        .sortStringArray(badSqlGrammarCodes);
100:            }
101:
102:            public String[] getBadSqlGrammarCodes() {
103:                return this .badSqlGrammarCodes;
104:            }
105:
106:            public void setInvalidResultSetAccessCodes(
107:                    String[] invalidResultSetAccessCodes) {
108:                this .invalidResultSetAccessCodes = invalidResultSetAccessCodes;
109:            }
110:
111:            public String[] getInvalidResultSetAccessCodes() {
112:                return this .invalidResultSetAccessCodes;
113:            }
114:
115:            public void setDataAccessResourceFailureCodes(
116:                    String[] dataAccessResourceFailureCodes) {
117:                this .dataAccessResourceFailureCodes = dataAccessResourceFailureCodes;
118:            }
119:
120:            public String[] getDataAccessResourceFailureCodes() {
121:                return this .dataAccessResourceFailureCodes;
122:            }
123:
124:            public void setPermissionDeniedCodes(String[] permissionDeniedCodes) {
125:                this .permissionDeniedCodes = StringUtils
126:                        .sortStringArray(permissionDeniedCodes);
127:            }
128:
129:            public String[] getPermissionDeniedCodes() {
130:                return this .permissionDeniedCodes;
131:            }
132:
133:            public void setDataIntegrityViolationCodes(
134:                    String[] dataIntegrityViolationCodes) {
135:                this .dataIntegrityViolationCodes = StringUtils
136:                        .sortStringArray(dataIntegrityViolationCodes);
137:            }
138:
139:            public String[] getDataIntegrityViolationCodes() {
140:                return this .dataIntegrityViolationCodes;
141:            }
142:
143:            public void setCannotAcquireLockCodes(
144:                    String[] cannotAcquireLockCodes) {
145:                this .cannotAcquireLockCodes = StringUtils
146:                        .sortStringArray(cannotAcquireLockCodes);
147:            }
148:
149:            public String[] getCannotAcquireLockCodes() {
150:                return this .cannotAcquireLockCodes;
151:            }
152:
153:            public void setDeadlockLoserCodes(String[] deadlockLoserCodes) {
154:                this .deadlockLoserCodes = deadlockLoserCodes;
155:            }
156:
157:            public String[] getDeadlockLoserCodes() {
158:                return this .deadlockLoserCodes;
159:            }
160:
161:            public void setCannotSerializeTransactionCodes(
162:                    String[] cannotSerializeTransactionCodes) {
163:                this .cannotSerializeTransactionCodes = cannotSerializeTransactionCodes;
164:            }
165:
166:            public String[] getCannotSerializeTransactionCodes() {
167:                return this .cannotSerializeTransactionCodes;
168:            }
169:
170:            public void setCustomTranslations(
171:                    CustomSQLErrorCodesTranslation[] customTranslations) {
172:                this .customTranslations = customTranslations;
173:            }
174:
175:            public CustomSQLErrorCodesTranslation[] getCustomTranslations() {
176:                return this.customTranslations;
177:            }
178:
179:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.