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

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


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



    // Create ProductVersionHolder in security block for Java 2 security.
    private static ProductVersionHolder buildProductVersionHolder() throws
            java.security.PrivilegedActionException, IOException {
        ProductVersionHolder myPVH = null;
        myPVH = (ProductVersionHolder)
                AccessController.doPrivileged(new PrivilegedExceptionAction() {

                    public Object run() throws IOException {
                        InputStream versionStream = getClass().getResourceAsStream(ProductGenusNames.DNC_INFO);
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

   

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

    return jbmsVersion.getMinorVersion()*100 +jbmsVersion.getMaintVersion() + (jbmsVersion.isBeta() ? 0 : 1) + 2;
  }
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 = 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

    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

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.