Source Code Cross Referenced for Course.java in  » Groupware » hipergate » com » knowgate » training » 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 » Groupware » hipergate » com.knowgate.training 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.knowgate.training;
002:
003:        /*
004:         Copyright (C) 2003-2005  Know Gate S.L. All rights reserved.
005:         C/Oņa, 107 1š2 28050 Madrid (Spain)
006:
007:         Redistribution and use in source and binary forms, with or without
008:         modification, are permitted provided that the following conditions
009:         are met:
010:
011:         1. Redistributions of source code must retain the above copyright
012:         notice, this list of conditions and the following disclaimer.
013:
014:         2. The end-user documentation included with the redistribution,
015:         if any, must include the following acknowledgment:
016:         "This product includes software parts from hipergate
017:         (http://www.hipergate.org/)."
018:         Alternately, this acknowledgment may appear in the software itself,
019:         if and wherever such third-party acknowledgments normally appear.
020:
021:         3. The name hipergate must not be used to endorse or promote products
022:         derived from this software without prior written permission.
023:         Products derived from this software may not be called hipergate,
024:         nor may hipergate appear in their name, without prior written
025:         permission.
026:
027:         This library is distributed in the hope that it will be useful,
028:         but WITHOUT ANY WARRANTY; without even the implied warranty of
029:         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
030:
031:         You should have received a copy of hipergate License with this code;
032:         if not, visit http://www.hipergate.org or mail to info@hipergate.org
033:         */
034:
035:        import java.util.Date;
036:        import java.sql.SQLException;
037:        import java.sql.PreparedStatement;
038:        import java.sql.CallableStatement;
039:        import java.sql.ResultSet;
040:
041:        import com.knowgate.debug.DebugFile;
042:        import com.knowgate.jdc.JDCConnection;
043:        import com.knowgate.dataobjs.DB;
044:        import com.knowgate.dataobjs.DBPersist;
045:
046:        import com.knowgate.misc.Gadgets;
047:        import com.knowgate.dataobjs.DBSubset;
048:
049:        /**
050:         * @author Sergio Montoro Ten
051:         * @version 2.2
052:         */
053:
054:        public class Course extends DBPersist {
055:
056:            public Course() {
057:                super (DB.k_courses, "Course");
058:            }
059:
060:            public Course(JDCConnection oConn, String sGuCourse)
061:                    throws SQLException {
062:                super (DB.k_courses, "Course");
063:                load(oConn, new Object[] { sGuCourse });
064:            }
065:
066:            // ---------------------------------------------------------------------------
067:
068:            public boolean active() {
069:                boolean bRetVal;
070:                if (isNull(DB.bo_active))
071:                    bRetVal = false;
072:                else
073:                    bRetVal = (getShort(DB.bo_active) == (short) 1);
074:                return bRetVal;
075:            } // active
076:
077:            // ---------------------------------------------------------------------------
078:
079:            public boolean store(JDCConnection oConn) throws SQLException {
080:                if (!AllVals.containsKey(DB.dt_modified))
081:                    AllVals.put(DB.dt_modified, new Date());
082:                if (!AllVals.containsKey(DB.gu_course))
083:                    AllVals.put(DB.gu_course, Gadgets.generateUUID());
084:                return super .store(oConn);
085:            }
086:
087:            // ---------------------------------------------------------------------------
088:
089:            public boolean delete(JDCConnection oConn) throws SQLException {
090:                return Course.delete(oConn, getString(DB.gu_course));
091:            }
092:
093:            // ---------------------------------------------------------------------------
094:
095:            public AcademicCourse[] getAcademicCourses(JDCConnection oConn)
096:                    throws SQLException {
097:                AcademicCourse[] aACrss = null;
098:                DBSubset oACrss = new DBSubset(DB.k_academic_courses,
099:                        new AcademicCourse().getTable(oConn).getColumnsStr(),
100:                        DB.gu_course + "=? ORDER BY " + DB.dt_created, 10);
101:                int nACrss = oACrss.load(oConn,
102:                        new Object[] { get(DB.gu_course) });
103:                if (nACrss > 0) {
104:                    aACrss = new AcademicCourse[nACrss];
105:                    for (int a = 0; a < nACrss; a++) {
106:                        aACrss[a] = new AcademicCourse();
107:                        aACrss[a].putAll(oACrss.getRowAsMap(a));
108:                    } // next
109:                } // fi
110:                return aACrss;
111:            } // getAcademicCourses
112:
113:            // ---------------------------------------------------------------------------
114:
115:            public Subject[] getSubjects(JDCConnection oConn)
116:                    throws SQLException {
117:                Subject[] aSubjs = null;
118:                DBSubset oSubjs = new DBSubset(DB.k_subjects, new Subject()
119:                        .getTable(oConn).getColumnsStr(), DB.gu_workarea
120:                        + "=? AND " + DB.gu_course + "=? ORDER BY "
121:                        + DB.nm_subject, 50);
122:                int nSubjs = oSubjs.load(oConn, new Object[] {
123:                        get(DB.gu_workarea), get(DB.gu_course) });
124:                if (nSubjs > 0) {
125:                    aSubjs = new Subject[nSubjs];
126:                    for (int s = 0; s < nSubjs; s++) {
127:                        aSubjs[s] = new Subject();
128:                        aSubjs[s].putAll(oSubjs.getRowAsMap(s));
129:                    } // next
130:                } // fi
131:                return aSubjs;
132:            } // getSubjects
133:
134:            // ---------------------------------------------------------------------------
135:
136:            public static boolean delete(JDCConnection oConn, String sGuCourse)
137:                    throws SQLException {
138:                if (DebugFile.trace) {
139:                    DebugFile.writeln("Begin Course.delete([JDCConnection],"
140:                            + sGuCourse + ")");
141:                    DebugFile.incIdent();
142:                }
143:                if (oConn.getDataBaseProduct() == JDCConnection.DBMS_POSTGRESQL) {
144:                    if (DebugFile.trace)
145:                        DebugFile
146:                                .writeln("Connection.prepareStatement(SELECT k_sp_del_course('"
147:                                        + sGuCourse + "'))");
148:                    PreparedStatement oStmt = oConn
149:                            .prepareStatement("SELECT k_sp_del_course(?)");
150:                    oStmt.setString(1, sGuCourse);
151:                    oStmt.executeQuery();
152:                    oStmt.close();
153:                } else {
154:                    if (DebugFile.trace)
155:                        DebugFile
156:                                .writeln("Connection.prepareCall({ call k_sp_del_course('"
157:                                        + sGuCourse + "') })");
158:                    CallableStatement oCall = oConn
159:                            .prepareCall("{ call k_sp_del_course(?) }");
160:                    oCall.setString(1, sGuCourse);
161:                    oCall.execute();
162:                    oCall.close();
163:                }
164:                if (DebugFile.trace) {
165:                    DebugFile.decIdent();
166:                    DebugFile.writeln("End Course.delete()");
167:                }
168:                return true;
169:            }
170:
171:            // **********************************************************
172:            // Public Constants
173:
174:            public static final short ClassId = 60;
175:
176:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.