Source Code Cross Referenced for ResultSetTypeEnum.java in  » Inversion-of-Control » carbon » org » sape » carbon » services » sql » 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 » Inversion of Control » carbon » org.sape.carbon.services.sql 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:/*
002: * The contents of this  file are subject to the Sapient Public License
003: * Version 1.0 (the "License"); you may not use this  file except in compliance
004: * with the License. You may obtain a copy of the License at
005: * http://carbon.sf.net/License.html.
006: *
007: * Software distributed under the License is distributed on an "AS IS" basis,
008: * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
009: * the specific language governing rights and limitations under the License.
010: *
011: * The Original Code is The Carbon Component Framework.
012: *
013: * The Initial Developer of the Original Code is Sapient Corporation
014: *
015: * Copyright (C) 2003 Sapient Corporation. All Rights Reserved.
016: */
017:
018:package org.sape.carbon.services.sql;
019:
020:
021:import java.io.ObjectStreamException;
022:import java.io.Serializable;
023:import java.sql.ResultSet;
024:import java.util.Iterator;
025:
026:import org.sape.carbon.core.util.enum.BaseEnum;
027:import org.sape.carbon.core.util.enum.EnumNotFoundException;
028:
029:
030:/**
031: * <P>This is an enumeration of the supported Result Set types. These types
032: * are used in the creation of a connection for the purposes of configuring
033: * the type of Result Set that will be returned.</P>
034: *
035: * Copyright 2002 Sapient
036: * @since carbon 1.0
037: * @see java.sql.ResultSet
038: * @author Greg Hinkle, July 2002
039: * @version $Revision: 1.6 $($Author: dvoet $ / $Date: 2003/05/05 21:21:36 $)
040: */
041:public class ResultSetTypeEnum extends BaseEnum implements  Serializable {
042:
043:
044:    /**
045:     * Represents the forward only type of result set
046:     * @see java.sql.ResultSet#TYPE_FORWARD_ONLY
047:     */
048:    public static final ResultSetTypeEnum FORWARD_ONLY =
049:        new ResultSetTypeEnum("TYPE_FORWARD_ONLY",
050:                ResultSet.TYPE_FORWARD_ONLY);
051:
052:    /**
053:     * Represents the scroll insensitive type of result set
054:     * @see java.sql.ResultSet#TYPE_SCROLL_INSENSITIVE
055:     */
056:    public static final ResultSetTypeEnum SCROLL_INSENSITIVE =
057:        new ResultSetTypeEnum("TYPE_SCROLL_INSENSITIVE",
058:                ResultSet.TYPE_SCROLL_INSENSITIVE);
059:
060:    /**
061:     * Represents the scroll sensitive type of result set
062:     * @see java.sql.ResultSet#TYPE_SCROLL_SENSITIVE
063:     */
064:    public static final ResultSetTypeEnum SCROLL_SENSITIVE =
065:        new ResultSetTypeEnum("TYPE_SCROLL_SENSITIVE",
066:                ResultSet.TYPE_SCROLL_SENSITIVE);
067:
068:    /**
069:     * Constructs a enumeration of type <code>ResultSetTypeEnum</code>
070:     *
071:     * @param name the String name of a enumeration instance
072:     * @param ordinal the integer ordinal value of a specific
073:     *        enumeration instance
074:     */
075:    private ResultSetTypeEnum(String name, int ordinal) {
076:        super (ResultSetTypeEnum.class, name, ordinal);
077:    }
078:
079:
080:    /**
081:     * Looks up a <code>ResultSetTypeEnum</code> by its string representation
082:     *
083:     * @param name the String name of a enumeration instance
084:     * @return an specific <code>ResultSetTypeEnum</code>
085:     * @throws ResultSetTypeEnumNotFoundException when there is no
086:     *         enumeration instance for the given name
087:     */
088:    public static final ResultSetTypeEnum getByName(String name)
089:            throws ResultSetTypeEnumNotFoundException {
090:
091:        ResultSetTypeEnum enum =  (ResultSetTypeEnum)
092:        BaseEnum.getByName(name, ResultSetTypeEnum.class);
093:        if (enum != null) {
094:            return enum;
095:        } else {
096:            throw new ResultSetTypeEnumNotFoundException(name);
097:        }
098:    }
099:
100:    /**
101:     * Looks up a <code>ResultSetTypeEnum</code> by its ordinal representation
102:     *
103:     * @param ordinal the integer ordinal value of a specific
104:     *        enumeration instance
105:     * @return an specific <code>ResultSetTypeEnum</code>
106:     * @throws ResultSetTypeEnumNotFoundException when there is no
107:     *         enumeration instance for the given ordinal
108:     */
109:    public static ResultSetTypeEnum getByOrdinal(int ordinal)
110:            throws ResultSetTypeEnumNotFoundException {
111:
112:        ResultSetTypeEnum enum =
113:            (ResultSetTypeEnum)
114:            BaseEnum.getByOrdinal(ordinal, ResultSetTypeEnum.class);
115:
116:        if (enum != null) {
117:            return enum;
118:        } else {
119:            throw new ResultSetTypeEnum.ResultSetTypeEnumNotFoundException(
120:            (new Long(ordinal)).toString());
121:        }
122:    }
123:
124:    /**
125:     * Retrieves and iterator by ascending ordinal order for all enumerations
126:     * of this type.
127:     *
128:     * @return an iterator over all <code>ResultSetTypeEnum</code>
129:     */
130:    public static Iterator iterator() {
131:        return BaseEnum.iterator(ResultSetTypeEnum.class);
132:    }
133:
134:    /**
135:     * Overrides part of serialization to return a reference to an
136:     * enumeration instance that is managed by the Enumeration Subsystem.
137:     * This will always return the SAME object instance for any single
138:     * enum instance and is what allows the "==" operator to be used for
139:     * comparisons.
140:     *
141:     * @throws ObjectStreamException indicates there is a failure to
142:     *         resolve the streamed object due to a format or read io
143:     *         exception
144:     * @return the object instance that should be resolved by this class
145:     */
146:    final Object readResolve() throws ObjectStreamException {
147:        return super .getByOrdinal(this .ordinal, ResultSetTypeEnum.class);
148:    }
149:
150:    /**
151:     * This class is a typesafe retriever excepection for an enumeration
152:     */
153:    public static class ResultSetTypeEnumNotFoundException
154:            extends EnumNotFoundException {
155:
156:        /**
157:         * @see EnumNotFoundException#EnumNotFoundException
158:         */
159:        public ResultSetTypeEnumNotFoundException(String name) {
160:            super (ResultSetTypeEnum.class, name);
161:        }
162:    }
163:
164:
165:}
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.