Package org.apache.derby.iapi.services.info

Examples of org.apache.derby.iapi.services.info.ProductVersionHolder


     * What's the version of this database product?
     *
     * @return database version
     */
  public String getDatabaseProductVersion() {
    ProductVersionHolder myPVH = Monitor.getMonitor().getEngineVersion();

    return myPVH.getVersionBuildString(true);
  }
View Full Code Here


    *
    * @return the underlying database's major version
  */
  public int getDatabaseMajorVersion()
  {
    ProductVersionHolder pvh = Monitor.getMonitor().getEngineVersion();
    if (pvh == null)
    {
      return -1;
    }
    return pvh.getMajorVersion();
  }
View Full Code Here

    *
    * @return the underlying database's minor version
  */
  public int getDatabaseMinorVersion()
  {
    ProductVersionHolder pvh = Monitor.getMonitor().getEngineVersion();
    if (pvh == null)
    {
      return -1;
    }
    return pvh.getMinorVersion();
  }
View Full Code Here

   

   */
  private int getJBMSMinorVersionNumber()
  {
    ProductVersionHolder jbmsVersion = Monitor.getMonitor().getEngineVersion();

    return jbmsVersion.getMinorVersion()*100 +jbmsVersion.getMaintVersion() + (jbmsVersion.isBeta() ? 0 : 1) + 2;
  }
View Full Code Here

   

   */
  private int getJBMSMinorVersionNumber()
  {
    ProductVersionHolder jbmsVersion = Monitor.getMonitor().getEngineVersion();

    return jbmsVersion.getMinorVersion()*100 +jbmsVersion.getMaintVersion() + (jbmsVersion.isBeta() ? 0 : 1) + 2;
  }
View Full Code Here

    m = c.getMethod("getMajorVersion", null);
    major = (Integer)m.invoke(o,null);
    m = c.getMethod("getMinorVersion", null);
    minor = (Integer)m.invoke(o,null);

    ProductVersionHolder jccVersion = ProductVersionHolder.getProductVersionHolder(
      "IBM Corp.",
      "DB2 Java Common Client",
      "DRDA:jcc",
      major.intValue(),
      minor.intValue(),
View Full Code Here

    m = c.getMethod("getMajorVersion", null);
    major = (Integer)m.invoke(o,null);
    m = c.getMethod("getMinorVersion", null);
    minor = (Integer)m.invoke(o,null);

    ProductVersionHolder jccVersion = ProductVersionHolder.getProductVersionHolder(
      "IBM Corp.",
      "DB2 Java Common Client",
      "DRDA:jcc",
      major.intValue(),
      minor.intValue(),
View Full Code Here

      // figure out which version this is
      InputStream versionStream = (InputStream) java.security.AccessController.doPrivileged(this);

      // figure out which version this is
      ProductVersionHolder ijVersion =
        ProductVersionHolder.getProductVersionHolderFromMyEnv(versionStream);

      String version;
      if (ijVersion != null)
      {
        version = "" + ijVersion.getMajorVersion() + "." +
          ijVersion.getMinorVersion();
      }
      else
      {
        version = "?";
      }
View Full Code Here

    langUtil = new LocalizedResource(null,null,DRDA_PROP_MESSAGES);

    serverInstance = this;
   
    //set Server attributes to be used in EXCSAT
    ProductVersionHolder myPVH = getNetProductVersionHolder();
    att_extnam = ATT_SRVNAM + " " + java.lang.Thread.currentThread().getName();
   
    att_srvclsnm = myPVH.getProductName();
    versionString = myPVH.getVersionBuildString(true);
   
    String majorStr = String.valueOf(myPVH.getMajorVersion());
    String minorStr = String.valueOf(myPVH.getMinorVersion());
    // Maintenance version. Server protocol version.
    // Only changed if client needs to recognize a new server version.
    String drdaMaintStr = String.valueOf(myPVH.getDrdaMaintVersion());

    // PRDID format as JCC expects it: CSSMMmx
    // MM = major version
    // mm = minor version
    // x = drda MaintenanceVersion

    prdId = DRDAConstants.DERBY_DRDA_SERVER_ID;
    if (majorStr.length() == 1)
      prdId += "0";
    prdId += majorStr;

    if (minorStr.length() == 1)
      prdId += "0";

    prdId += minorStr;
   
    prdId += drdaMaintStr;
    att_srvrlslv = prdId + "/" + myPVH.getVersionBuildString(true);
                // Precompute this to save some cycles
                prdIdBytes_ = prdId.getBytes(DEFAULT_ENCODING);
    if (SanityManager.DEBUG)
    {
      if (majorStr.length() > ||
        minorStr.length() > 2 ||
        drdaMaintStr.length() > 1)
        SanityManager.THROWASSERT("version values out of expected range  for PRDID");
    }

    buildNumber = myPVH.getBuildNumber();
  }
View Full Code Here

   * and won't be readily available to ProductVersionHolder when running
   * under security manager.
   */
  private ProductVersionHolder getNetProductVersionHolder() throws Exception
  {
    ProductVersionHolder myPVH= null;
    try {
      myPVH = (ProductVersionHolder) AccessController.doPrivileged(
                new PrivilegedExceptionAction() {
                   
                  public Object run() throws UnknownHostException,IOException
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.services.info.ProductVersionHolder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.