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

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


        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 = AccessController.doPrivileged(
                new PrivilegedExceptionAction<ProductVersionHolder>() {
                    public ProductVersionHolder run()
                            throws UnknownHostException, IOException {
View Full Code Here

   */
  public static boolean isFullUpgrade(Properties startParams, String oldVersionInfo) throws StandardException {

    boolean fullUpgrade = Boolean.valueOf(startParams.getProperty(org.apache.derby.iapi.reference.Attribute.UPGRADE_ATTR)).booleanValue();

    ProductVersionHolder engineVersion = Monitor.getMonitor().getEngineVersion();

    if (engineVersion.isBeta() || engineVersion.isAlpha()) {
         
      if (!PropertyUtil.getSystemBoolean(Property.ALPHA_BETA_ALLOW_UPGRADE))
      {
        //  upgrade not supported for alpha/beta.
        throw StandardException.newException(SQLState.UPGRADE_UNSUPPORTED,
            oldVersionInfo, engineVersion.getSimpleVersionString());
      }
    }

    return fullUpgrade;
  }
View Full Code Here

     * 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

      // figure out which version this is
            InputStream versionStream = util.getResourceAsStream(
                    ProductGenusNames.TOOLS_INFO);

      // 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

      DBMS, TOOLS, NET, CLIENT
    @return the major version. Return -1 if the information is not found.
    */   
  static public int getMajorVersion(String genus)
  {
        ProductVersionHolder pvh = ProductVersionHolder.getProductVersionHolderFromMyEnv(genus);
        if (pvh == null)
        {
            return -1;
        }

        return pvh.getMajorVersion();
  }
View Full Code Here

      DBMS, TOOLS, NET, CLIENT.
    @return the minor version. Return -1 if the information is not found.
    */ 
  static public int getMinorVersion(String genus)
  {
        ProductVersionHolder pvh = ProductVersionHolder.getProductVersionHolderFromMyEnv(genus);
        if (pvh == null)
        {
            return -1;
        }

        return pvh.getMinorVersion();
  }
View Full Code Here

      DBMS, TOOLS, NET, CLIENT.
    @return the build number, or ???? if the information is not found.
  */
  static public String getBuildNumber(String genus)
  {
        ProductVersionHolder pvh = ProductVersionHolder.getProductVersionHolderFromMyEnv(genus);
        if (pvh == null)
        {
            return "????";
        }

        return pvh.getBuildNumber();
  }
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.