Source Code Cross Referenced for LoadError.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » impl » load » 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 DBMS » db derby 10.2 » org.apache.derby.impl.load 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:
003:           Derby - Class org.apache.derby.impl.load.LoadError
004:
005:           Licensed to the Apache Software Foundation (ASF) under one or more
006:           contributor license agreements.  See the NOTICE file distributed with
007:           this work for additional information regarding copyright ownership.
008:           The ASF licenses this file to You under the Apache License, Version 2.0
009:           (the "License"); you may not use this file except in compliance with
010:           the License.  You may obtain a copy of the License at
011:
012:              http://www.apache.org/licenses/LICENSE-2.0
013:
014:           Unless required by applicable law or agreed to in writing, software
015:           distributed under the License is distributed on an "AS IS" BASIS,
016:           WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017:           See the License for the specific language governing permissions and
018:           limitations under the License.
019:
020:         */
021:
022:        package org.apache.derby.impl.load;
023:
024:        import java.sql.SQLException;
025:        import org.apache.derby.iapi.error.ExceptionSeverity;
026:        import org.apache.derby.iapi.reference.SQLState;
027:        import org.apache.derby.iapi.error.StandardException;
028:        import org.apache.derby.iapi.error.PublicAPI;
029:
030:        /**
031:         * These exceptions are thrown by the import and export modules.
032:         * 
033:         *
034:         * @author Mamta Satoor
035:         @see SQLException
036:         */
037:        class LoadError {
038:
039:            /**
040:             Raised if, the Cloudscape database connection is null.
041:             */
042:
043:            static SQLException connectionNull() {
044:                return PublicAPI.wrapStandardException(StandardException
045:                        .newException(SQLState.CONNECTION_NULL));
046:            }
047:
048:            /**
049:               Raised if, there is data found between the stop delimiter and field/record spearator.
050:               @param lineNumber Found invalid data on this line number in the data file
051:               @param columnNumber Found invalid data for this column number in the data file
052:             */
053:            static SQLException dataAfterStopDelimiter(int lineNumber,
054:                    int columnNumber) {
055:                return PublicAPI.wrapStandardException(StandardException
056:                        .newException(SQLState.DATA_AFTER_STOP_DELIMITER,
057:                                new Integer(lineNumber), new Integer(
058:                                        columnNumber)));
059:            }
060:
061:            /**
062:               Raised if, the passed data file can't be found.
063:               @param fileName the data file name 
064:             */
065:            static SQLException dataFileNotFound(String fileName) {
066:
067:                return PublicAPI.wrapStandardException(StandardException
068:                        .newException(SQLState.DATA_FILE_NOT_FOUND, fileName));
069:            }
070:
071:            /**
072:               Raised if, null is passed for data file url.
073:             */
074:            static SQLException dataFileNull() {
075:                return PublicAPI.wrapStandardException(StandardException
076:                        .newException(SQLState.DATA_FILE_NULL));
077:            }
078:
079:            /**
080:               Raised if, the entity (ie table/view) for import/export is missing in the database.
081:             */
082:
083:            static SQLException entityNameMissing() {
084:                return PublicAPI.wrapStandardException(StandardException
085:                        .newException(SQLState.ENTITY_NAME_MISSING));
086:
087:            }
088:
089:            /**
090:               Raised if, field & record separators are substring of each other.
091:             */
092:            static SQLException fieldAndRecordSeparatorsSubset() {
093:                return PublicAPI
094:                        .wrapStandardException(StandardException
095:                                .newException(SQLState.FIELD_IS_RECORD_SEPERATOR_SUBSET));
096:            }
097:
098:            /**
099:               Raised if, no column by given name is found in the resultset while importing.
100:               @param columnName the resultset doesn't have this column name
101:             */
102:            static SQLException invalidColumnName(String columnName) {
103:                return PublicAPI
104:                        .wrapStandardException(StandardException.newException(
105:                                SQLState.INVALID_COLUMN_NAME, columnName));
106:
107:            }
108:
109:            /**
110:               Raised if, no column by given number is found in the resultset while importing.
111:               @param numberOfColumns the resultset doesn't have this column number
112:             */
113:            static SQLException invalidColumnNumber(int numberOfColumns) {
114:
115:                return PublicAPI.wrapStandardException(StandardException
116:                        .newException(SQLState.INVALID_COLUMN_NUMBER,
117:                                new Integer(numberOfColumns)));
118:            }
119:
120:            /**
121:               Raised if, trying to export/import from an entity which has non supported
122:               type columns in it.
123:             */
124:            static SQLException nonSupportedTypeColumn(String columnName,
125:                    String typeName) {
126:                return PublicAPI.wrapStandardException(StandardException
127:                        .newException(SQLState.UNSUPPORTED_COLUMN_TYPE,
128:                                columnName, typeName));
129:            }
130:
131:            /**
132:               Raised if, in case of fixed format, don't find the record separator for a row in the data file.
133:               @param lineNumber the line number with the missing record separator in the data file
134:             */
135:            static SQLException recordSeparatorMissing(int lineNumber) {
136:
137:                return PublicAPI.wrapStandardException(StandardException
138:                        .newException(SQLState.RECORD_SEPERATOR_MISSING,
139:                                new Integer(lineNumber)));
140:            }
141:
142:            /**
143:               Raised if, in case of fixed format, reach end of file before reading data for all the columns.
144:             */
145:            static SQLException unexpectedEndOfFile(int lineNumber) {
146:                return PublicAPI.wrapStandardException(StandardException
147:                        .newException(SQLState.UNEXPECTED_END_OF_FILE,
148:                                new Integer(lineNumber)));
149:            }
150:
151:            /**
152:               Raised if, got IOException while writing data to the file.
153:             */
154:            static SQLException errorWritingData() {
155:                return PublicAPI.wrapStandardException(StandardException
156:                        .newException(SQLState.ERROR_WRITING_DATA));
157:            }
158:
159:            /*
160:             * Raised if period(.) is used a character delimiter
161:             */
162:            static SQLException periodAsCharDelimiterNotAllowed() {
163:                return PublicAPI
164:                        .wrapStandardException(StandardException
165:                                .newException(SQLState.PERIOD_AS_CHAR_DELIMITER_NOT_ALLOWED));
166:            }
167:
168:            /*
169:             * Raised if same delimiter character is used for more than one delimiter
170:             * type . For eg using ';' for both column delimter and character delimter
171:             */
172:            static SQLException delimitersAreNotMutuallyExclusive() {
173:                return PublicAPI
174:                        .wrapStandardException(StandardException
175:                                .newException(SQLState.DELIMITERS_ARE_NOT_MUTUALLY_EXCLUSIVE));
176:            }
177:
178:            static SQLException tableNotFound(String tableName) {
179:
180:                return PublicAPI.wrapStandardException(StandardException
181:                        .newException(SQLState.TABLE_NOT_FOUND, tableName));
182:            }
183:
184:            /* Wrapper to throw an unknown excepton duing Import/Export.
185:             * Typically this can be some IO error which is not generic error
186:             * like the above error messages. 
187:             */
188:
189:            static SQLException unexpectedError(Throwable t) {
190:                if (!(t instanceof  SQLException)) {
191:                    return PublicAPI.wrapStandardException(StandardException
192:                            .plainWrapException(t));
193:                } else
194:                    return (SQLException) t;
195:            }
196:
197:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.