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

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



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

                    public ProductVersionHolder 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(false);
  }
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

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

    if (true || !fullUpgrade) {

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

      if (engineVersion.isBeta() || engineVersion.isAlpha()) {
        // soft upgrade not supported for beta.
        throw StandardException.newException(SQLState.NO_UPGRADE, oldVersionInfo, engineVersion.getSimpleVersionString());
      }

      // Gandalf release does not support any soft or hard upgrade,
      // remove this exception when upgrade support is added, and
      // add back in the following code which has been commented out
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();

    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 = "CSS";
    if (majorStr.length() == 1)
      prdId += "0";
    prdId += majorStr;

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

    prdId += minorStr;
   
    prdId += drdaMaintStr;
    att_srvrlslv = prdId + "/" + myPVH.getVersionBuildString(false);
   
    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

   

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

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