Source Code Cross Referenced for Severity.java in  » Issue-Tracking » javafreedom-bugtracker » com » espada » bugtracker » app » 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 » Issue Tracking » javafreedom bugtracker » com.espada.bugtracker.app 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (c) 2000, Manik Surtani <manik@post1.com> All rights reserved.
003:         *
004:         * Redistribution and use in source and binary forms, with or without
005:         * modification, are permitted provided that the following conditions
006:         * are met:
007:         *
008:         * 1. Redistributions of source code must retain the above copyright
009:         *    notice, this list of conditions and the following disclaimer.
010:         *
011:         * 2. Redistributions in binary form must reproduce the above copyright
012:         *    notice, this list of conditions and the following disclaimer in
013:         *    the documentation and/or other materials provided with the
014:         *    distribution.
015:         *
016:         * 3. All advertising materials mentioning features or use of this
017:         *    software must display the following acknowledgment:
018:         *    "This product includes software developed by Manik Surtani
019:         *    for use in the "BugTracker" JSP/servlet application
020:         *    <http://loonix.espadanet.com/>."
021:         *
022:         * 4. The name "BugTracker" must not be used to endorse or promote products
023:         *    derived from this software without prior written permission.
024:         *
025:         * 5. Products derived from this software may not be called "BugTracker"
026:         *    nor may "BugTracker" nor "Loonix" appear in their names without
027:         *    prior written permission of Manik Surtani.
028:         *
029:         * 6. Redistributions of any form whatsoever must retain the following
030:         *    acknowledgment:
031:         *    "This product includes software developed by Manik Surtani
032:         *    for use in the "BugTracker" JSP/servlet application
033:         *    <http://loonix.espadanet.com/>."
034:         *
035:         * THIS SOFTWARE IS PROVIDED BY MANIK SURTANI PROJECT "AS IS" AND ANY
036:         * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
037:         * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
038:         * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE JAVA APACHE PROJECT OR
039:         * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
040:         * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
041:         * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
042:         * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
043:         * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
044:         * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
045:         * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
046:         * OF THE POSSIBILITY OF SUCH DAMAGE.
047:         *
048:         *
049:         */
050:
051:        package com.espada.bugtracker.app;
052:
053:        // Java core packages:
054:        import java.io.*;
055:        import java.sql.*;
056:        import java.util.*;
057:
058:        // Espada DB Pool API
059:        import com.sr.espada.se.util.db.pool.*;
060:
061:        // Bugtracker API
062:        import com.espada.bugtracker.app.*;
063:
064:        /**
065:         * This is the Severity class, which is the core of the entire application.
066:         *
067:         *
068:         * @version: $Id: Severity.java,v 1.5 2001/03/13 07:43:44 manik Exp $<BR>
069:         * @author: Manik Surtani<BR>
070:         **/
071:
072:        public class Severity {
073:
074:            public int severityID;
075:
076:            public String severity;
077:
078:            public int weight;
079:
080:            public boolean def;
081:
082:            public Severity() {
083:
084:                //Default values
085:
086:            }
087:
088:            public Severity(int id) {
089:                try {
090:
091:                    Connection d = DatabaseConnectionPool.getConnection();
092:                    Statement st = d.createStatement();
093:                    ResultSet rs = st
094:                            .executeQuery("select * from severity where severity_id="
095:                                    + id);
096:
097:                    while (rs.next()) {
098:
099:                        severityID = id;
100:
101:                        severity = rs.getString(1);
102:
103:                        weight = rs.getInt(2);
104:
105:                        def = rs.getInt(3) == 1;
106:
107:                    }
108:
109:                    st.close();
110:                    DatabaseConnectionPool.freeConnection(d);
111:
112:                }
113:
114:                catch (Exception E) {
115:
116:                    //Exception handling
117:
118:                }
119:            } //end of method Severity
120:
121:            public String getName() {
122:
123:                return severity;
124:
125:            } //end of method getName
126:
127:            public int getID() {
128:
129:                return severityID;
130:
131:            } //end of method getID
132:
133:            public int getWeight() {
134:
135:                return weight;
136:
137:            } //end of method getWeight
138:
139:            public boolean isDefault() {
140:
141:                return def;
142:
143:            } //end of method isDefault
144:
145:            /**
146:             * Returns a Vector of all severities available.
147:             **/
148:            public static Vector getSeverities() {
149:
150:                Vector v = new Vector();
151:
152:                try {
153:                    Connection d = DatabaseConnectionPool.getConnection();
154:                    Statement st = d.createStatement();
155:                    ResultSet rs = st
156:                            .executeQuery("select severity_id from severity order by def");
157:
158:                    while (rs.next()) {
159:
160:                        v.add(new Severity(rs.getInt(1)));
161:
162:                    }
163:
164:                    st.close();
165:                    DatabaseConnectionPool.freeConnection(d);
166:                    return v;
167:                }
168:
169:                catch (Exception E) {
170:
171:                    E.printStackTrace();
172:                    v.add(new String("Error"));
173:                    v.add(E.getMessage());
174:                    return v;
175:
176:                }
177:
178:            } // end method.
179:
180:        } //end of class
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.