com.pega.pegarules.pub.database
Class DatabaseInformation

java.lang.Object
  extended by com.pega.pegarules.pub.database.DatabaseInformation

public class DatabaseInformation
extends java.lang.Object

An immutable representation of a particular database's meta data.

Version:
$Revision: 35858 $ $Date: 2012-10-03 09:44:46 -0400 (Wed, 03 Oct 2012) $
Author:
Jamie Gentry

Field Summary
static java.lang.String COPYRIGHT
           
static int DB_TYPE_APACHE
           
static int DB_TYPE_DB2UDB
           
static int DB_TYPE_DB2ZOS
           
static int DB_TYPE_GENERIC
          Constants that define the DB family
static int DB_TYPE_MSSQL
           
static int DB_TYPE_ORACLE
           
static int DB_TYPE_POSTGRES
           
static java.lang.String VERSION
           
 
Constructor Summary
DatabaseInformation(java.lang.String aProductName, java.lang.String aProductVersion, int aProductMajorVersion, int aProductMinorVersion, java.lang.String aDriverName, java.lang.String aDriverVersion, int aProductFamily, int aDriverMajorVersion, int aDriverMinorVersion)
           
DatabaseInformation(java.lang.String aProductName, java.lang.String aProductVersion, int aProductMajorVersion, int aProductMinorVersion, java.lang.String aDriverName, java.lang.String aDriverVersion, java.lang.String aConfigProductName, int aDriverMajorVersion, int aDriverMinorVersion)
          Creates driver information.
 
Method Summary
 int getDatabaseType()
          Returns the product family Type.
 java.lang.String getDefaultSchemaForConnection()
          Gets the Default schema name for connection as defined in Data-Admin-DB-Name configuration
 int getDriverMajorVersion()
          Gets the driverMajorVersion
 int getDriverMinorVersion()
          Gets the driverMinorVersion
 java.lang.String getDriverName()
          Gets the driverName
 java.lang.String getDriverVersion()
          Gets the driverVersion
 int getMaxEncodedCharSize()
          returns the max size of char in bytes, that it takes to write to database,If PRPC database is Unicode
 int getProductMajorVersion()
          Gets the productMajorVersion
 int getProductMinorVersion()
          Gets the productMinorVersion
 java.lang.String getProductName()
          Gets the productName
 java.lang.String getProductVersion()
          Gets the productVersion
 boolean isOracle()
           
 boolean isUnicodeDatabase()
          Returns if PRPC database instance is UNICODE or Not
 boolean isVersionAtLeast(java.lang.String aMinimunVersion)
          Determines if the version number is at least the given version number.
 void setDefaultSchemaForConnection(java.lang.String aDefaultSchemaForConnection)
          Sets the Default schema name for connection as defined in Data-Admin-DB-Name configuration this method is called from DatabaseInformationImpl explicitly to set the default schema name, The call from DatabaseInformationImpl is needed because mProductFamily is set only in this class.
 void setMaxEncodedCharSize(int maxEncodedCharSize)
          If PRPC database is Unicode, then max size of char in bytes, that it takes to write to database
 void setUnicodeDatabase(boolean isUnicodeDatabase)
          Sets if PRPC database instance is UNICODE or Not
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

VERSION

public static final java.lang.String VERSION

DB_TYPE_GENERIC

public static final int DB_TYPE_GENERIC
Constants that define the DB family

See Also:
Constant Field Values

DB_TYPE_MSSQL

public static final int DB_TYPE_MSSQL
See Also:
Constant Field Values

DB_TYPE_DB2UDB

public static final int DB_TYPE_DB2UDB
See Also:
Constant Field Values

DB_TYPE_DB2ZOS

public static final int DB_TYPE_DB2ZOS
See Also:
Constant Field Values

DB_TYPE_ORACLE

public static final int DB_TYPE_ORACLE
See Also:
Constant Field Values

DB_TYPE_APACHE

public static final int DB_TYPE_APACHE
See Also:
Constant Field Values

DB_TYPE_POSTGRES

public static final int DB_TYPE_POSTGRES
See Also:
Constant Field Values
Constructor Detail

DatabaseInformation

public DatabaseInformation(java.lang.String aProductName,
                           java.lang.String aProductVersion,
                           int aProductMajorVersion,
                           int aProductMinorVersion,
                           java.lang.String aDriverName,
                           java.lang.String aDriverVersion,
                           java.lang.String aConfigProductName,
                           int aDriverMajorVersion,
                           int aDriverMinorVersion)
Creates driver information.

Parameters:
aProductName - the product name
aProductVersion - the product version
aProductMajorVersion - the product version
aProductMinorVersion - the product version
aDriverName - the driver name
aDriverVersion - the driver version
aConfigProductName - the cofigured product name - For SQL generation
aDriverMajorVersion - the driver major version
aDriverMinorVersion - the driver minor version

DatabaseInformation

public DatabaseInformation(java.lang.String aProductName,
                           java.lang.String aProductVersion,
                           int aProductMajorVersion,
                           int aProductMinorVersion,
                           java.lang.String aDriverName,
                           java.lang.String aDriverVersion,
                           int aProductFamily,
                           int aDriverMajorVersion,
                           int aDriverMinorVersion)
Method Detail

getProductName

public java.lang.String getProductName()
Gets the productName

Returns:
Returns a String

getProductVersion

public java.lang.String getProductVersion()
Gets the productVersion

Returns:
Returns a String

getProductMajorVersion

public int getProductMajorVersion()
Gets the productMajorVersion

Returns:
Returns a int

getProductMinorVersion

public int getProductMinorVersion()
Gets the productMinorVersion

Returns:
Returns a int

getDriverName

public java.lang.String getDriverName()
Gets the driverName

Returns:
Returns a String

getDriverVersion

public java.lang.String getDriverVersion()
Gets the driverVersion

Returns:
Returns a String

getDriverMajorVersion

public int getDriverMajorVersion()
Gets the driverMajorVersion

Returns:
Returns a int

getDriverMinorVersion

public int getDriverMinorVersion()
Gets the driverMinorVersion

Returns:
Returns a int

getDefaultSchemaForConnection

public java.lang.String getDefaultSchemaForConnection()
Gets the Default schema name for connection as defined in Data-Admin-DB-Name configuration

Returns:
Returns the schema name

setDefaultSchemaForConnection

public void setDefaultSchemaForConnection(java.lang.String aDefaultSchemaForConnection)
Sets the Default schema name for connection as defined in Data-Admin-DB-Name configuration this method is called from DatabaseInformationImpl explicitly to set the default schema name, The call from DatabaseInformationImpl is needed because mProductFamily is set only in this class.

Parameters:
aDefaultSchemaForConnection - the schema name to set

isOracle

public boolean isOracle()

isVersionAtLeast

public boolean isVersionAtLeast(java.lang.String aMinimunVersion)
Determines if the version number is at least the given version number. Any unspecified parts of the version string are assumed to be zero.

Parameters:
aMinimunVersion - - a string representation of the desired minimum version can be dot seperated - i.e. 10.2
Returns:
true if the db product is at least the given version number

getDatabaseType

public int getDatabaseType()
Returns the product family Type.

Returns:
an integer that represents the database product family used for this connection

setUnicodeDatabase

public void setUnicodeDatabase(boolean isUnicodeDatabase)
Sets if PRPC database instance is UNICODE or Not

Parameters:
isUnicodeDatabase -

isUnicodeDatabase

public boolean isUnicodeDatabase()
Returns if PRPC database instance is UNICODE or Not

Returns:
the mIsUniocodeDatabase

getMaxEncodedCharSize

public int getMaxEncodedCharSize()
returns the max size of char in bytes, that it takes to write to database,If PRPC database is Unicode

Returns:
the mMaxUnicodeCharSize

setMaxEncodedCharSize

public void setMaxEncodedCharSize(int maxEncodedCharSize)
If PRPC database is Unicode, then max size of char in bytes, that it takes to write to database

Parameters:
maxEncodedCharSize - the mMaxUnicodeCharSize to set


Copyright © 2012 Pegasystems Inc. All Rights Reserved.