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


001:        /*
002:
003:           Derby - Class org.apache.derby.tools.sysinfo
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.tools;
023:
024:        import org.apache.derby.iapi.services.info.ProductVersionHolder;
025:        import org.apache.derby.iapi.services.info.JVMInfo;
026:        import org.apache.derby.impl.tools.sysinfo.Main;
027:
028:        /**
029:        
030:         This class displays system information to system out.
031:        
032:         To run from the command-line, enter the following:
033:         <p>
034:         <code>java org.apache.derby.tools.sysinfo</code>
035:         <p>
036:         <p>
037:         Also available on this class are methods which allow you to determine
038:         the version of the code for the system without actually booting a database.
039:         Please note that this is the Derby version of the .jar files, not of your databases.
040:         <p>
041:         The numbering scheme for released Derby products is <b><code>m1.m2.m3 </code></b>
042:         where <b><code>m1</code></b> is the major release version, <b><code>m2</code></b> is the minor release version,
043:         and <b><code>m3</code></b> is the maintenance level. Versions of the product with the same
044:         major and minor version numbers are considered feature compatible. 
045:         <p>Valid major and minor versions are always greater than zero. Valid maintenance
046:         versions are greater than or equal to zero.
047:
048:
049:         */
050:        public class sysinfo {
051:
052:            static public void main(String[] args) {
053:                Main.main(args);
054:            }
055:
056:            private sysinfo() { // no instances allowed
057:            }
058:
059:            /**
060:            	The genus name for the Apache Derby code. Use this to determine the version of the
061:            	Apache Derby embedded code in derby.jar.
062:             */
063:            public static final String DBMS = "DBMS";
064:
065:            /**
066:             *	The genus name for the tools code. Use this to determine the version of 
067:            	code in derbytools.jar
068:             */
069:            public static final String TOOLS = "tools";
070:
071:            /**
072:             *	The genus name for the network server code. Use this to determine the version of 
073:            	code in derbynet.jar
074:             */
075:            public static final String NET = "net";
076:
077:            /**
078:             *	The genus name for the client code. Use this to determine the version of 
079:            	code in derbyclient.jar
080:             */
081:            public static final String CLIENT = "dnc";
082:
083:            /**
084:            	gets the major version of the Apache Derby embedded code.
085:            	@return	the major version. Returns -1 if not found.
086:             */
087:            static public int getMajorVersion() {
088:                return getMajorVersion(DBMS);
089:            }
090:
091:            /**
092:            	gets the major version of the specified code library. 
093:            	@param genus	which library to get the version of. Valid inputs include
094:            		DBMS, TOOLS, NET, CLIENT
095:            	@return the major version. Return -1 if the information is not found. 
096:             */
097:            static public int getMajorVersion(String genus) {
098:                ProductVersionHolder pvh = ProductVersionHolder
099:                        .getProductVersionHolderFromMyEnv(genus);
100:                if (pvh == null) {
101:                    return -1;
102:                }
103:
104:                return pvh.getMajorVersion();
105:            }
106:
107:            /**
108:            	gets the minor version of the Apache Derby embedded code.
109:            	@return	the minor version. Returns -1 if not found.
110:             */
111:            static public int getMinorVersion() {
112:                return getMinorVersion(DBMS);
113:            }
114:
115:            /**
116:            	gets the minor version of the specified code library. 
117:            	@param genus	which library to get the version of. Valid inputs include
118:            		DBMS, TOOLS, NET, CLIENT.
119:            	@return the minor version. Return -1 if the information is not found. 
120:             */
121:            static public int getMinorVersion(String genus) {
122:                ProductVersionHolder pvh = ProductVersionHolder
123:                        .getProductVersionHolderFromMyEnv(genus);
124:                if (pvh == null) {
125:                    return -1;
126:                }
127:
128:                return pvh.getMinorVersion();
129:            }
130:
131:            /**
132:            	gets the build number for the Apache Derby embedded library
133:            	@return the build number, or -1 if the information is not found.
134:             */
135:            static public String getBuildNumber() {
136:                return getBuildNumber("DBMS");
137:            }
138:
139:            /**
140:            	gets the build number for the specified library
141:            	@param genus which library to get the build number for. Valid inputs are
142:            		DBMS, TOOLS, NET, CLIENT.
143:            	@return the build number, or ???? if the information is not found.
144:             */
145:            static public String getBuildNumber(String genus) {
146:                ProductVersionHolder pvh = ProductVersionHolder
147:                        .getProductVersionHolderFromMyEnv(genus);
148:                if (pvh == null) {
149:                    return "????";
150:                }
151:
152:                return pvh.getBuildNumber();
153:            }
154:
155:            /**
156:            	gets the product name for the Apache Derby embedded library
157:            	@return the name
158:             */
159:            static public String getProductName() {
160:                return getProductName("DBMS");
161:            }
162:
163:            /**
164:            	gets the external name for the specified code library.
165:            	@param genus which library to get the name for
166:            	@return the name.
167:             */
168:
169:            static public String getProductName(String genus) {
170:                ProductVersionHolder pvh = ProductVersionHolder
171:                        .getProductVersionHolderFromMyEnv(genus);
172:                if (pvh == null) {
173:                    return Main.getTextMessage("SIF01.K");
174:                }
175:
176:                return pvh.getProductName();
177:            }
178:
179:            /**
180:            Return the version information string for the specified library including alpha or beta indicators.
181:             */
182:            static public String getVersionString() {
183:                return getVersionString(DBMS);
184:            }
185:
186:            /**
187:            Return the version information string for the Apache Derby embedded library including alpha or beta indicators.
188:             */
189:            static public String getVersionString(String genus) {
190:
191:                ProductVersionHolder pvh = ProductVersionHolder
192:                        .getProductVersionHolderFromMyEnv(genus);
193:                if (pvh == null) {
194:                    return Main.getTextMessage("SIF01.K");
195:                }
196:
197:                return pvh.getVersionBuildString(false);
198:            }
199:
200:            public static void getInfo(java.io.PrintWriter out) {
201:                Main.getMainInfo(out, false);
202:            }
203:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.