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

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


    @return the name.
  */

  static public String getProductName(String genus)
  {
        ProductVersionHolder pvh = ProductVersionHolder.getProductVersionHolderFromMyEnv(genus);
        if (pvh == null)
        {
            return Main.getTextMessage ("SIF01.K");
        }

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


  /**
  Return the version information string for the Apache Derby embedded library including alpha or beta indicators.
  */
  static public String getVersionString(String genus) {

        ProductVersionHolder pvh = ProductVersionHolder.getProductVersionHolderFromMyEnv(genus);
        if (pvh == null)
        {
            return Main.getTextMessage ("SIF01.K");
        }
   
    return pvh.getVersionBuildString(false);
  }
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


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

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

   

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

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

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.