1 21 22 package org.apache.derby.tools; 23 24 import org.apache.derby.iapi.services.info.ProductVersionHolder; 25 import org.apache.derby.iapi.services.info.JVMInfo; 26 import org.apache.derby.impl.tools.sysinfo.Main; 27 28 50 public class sysinfo { 51 52 static public void main(String [] args) { 53 Main.main(args); 54 } 55 56 private sysinfo() { } 58 59 63 public static final String DBMS="DBMS"; 64 65 69 public static final String TOOLS="tools"; 70 71 75 public static final String NET="net"; 76 77 81 public static final String CLIENT="dnc"; 82 83 84 88 static public int getMajorVersion() 89 { 90 return getMajorVersion(DBMS); 91 } 92 93 94 100 static public int getMajorVersion(String genus) 101 { 102 ProductVersionHolder pvh = ProductVersionHolder.getProductVersionHolderFromMyEnv(genus); 103 if (pvh == null) 104 { 105 return -1; 106 } 107 108 return pvh.getMajorVersion(); 109 } 110 111 112 116 static public int getMinorVersion() 117 { 118 return getMinorVersion(DBMS); 119 } 120 121 127 static public int getMinorVersion(String genus) 128 { 129 ProductVersionHolder pvh = ProductVersionHolder.getProductVersionHolderFromMyEnv(genus); 130 if (pvh == null) 131 { 132 return -1; 133 } 134 135 return pvh.getMinorVersion(); 136 } 137 138 142 static public String getBuildNumber() 143 { 144 return getBuildNumber("DBMS"); 145 } 146 147 153 static public String getBuildNumber(String genus) 154 { 155 ProductVersionHolder pvh = ProductVersionHolder.getProductVersionHolderFromMyEnv(genus); 156 if (pvh == null) 157 { 158 return "????"; 159 } 160 161 return pvh.getBuildNumber(); 162 } 163 164 165 169 static public String getProductName() 170 { 171 return getProductName("DBMS"); 172 } 173 174 179 180 static public String getProductName(String genus) 181 { 182 ProductVersionHolder pvh = ProductVersionHolder.getProductVersionHolderFromMyEnv(genus); 183 if (pvh == null) 184 { 185 return Main.getTextMessage ("SIF01.K"); 186 } 187 188 return pvh.getProductName(); 189 } 190 191 194 static public String getVersionString() { 195 return getVersionString(DBMS); 196 } 197 198 201 static public String getVersionString(String genus) { 202 203 ProductVersionHolder pvh = ProductVersionHolder.getProductVersionHolderFromMyEnv(genus); 204 if (pvh == null) 205 { 206 return Main.getTextMessage ("SIF01.K"); 207 } 208 209 return pvh.getVersionBuildString(false); 210 } 211 212 public static void getInfo (java.io.PrintWriter out) { 213 Main.getMainInfo(out, false); 214 } 215 } 216 | Popular Tags |