DbtuTools project
Java Library

org.dbtutools.DbtuTools.core.db2
Class Instance

java.lang.Object
  |
  +--org.dbtutools.DbtuTools.core.db2.Instance

public class Instance
extends java.lang.Object

Wrapper class, implementing DB2 Instance related stuff.

Author:
Daniel Scheibli <daniel.scheibli at edelbyte.org>

Field Summary
protected  java.lang.String oInstanceName
          Field holding the name of the DB2 instance, which is addressed by the instance of this class.
 
Constructor Summary
Instance()
          Creates a new instance of this class and addressed the current DB2 Instance.

Background: This constructor calls a private method which interprets the value returned by java.lang.System.getProperty("DB2INSTANCE");
Instance(java.lang.String oInstanceName)
          Creates a new instance of this class - addressing the provided DB2 Instance name.

Remark: Please notice, the constructor does not check for the existence of the given DB2 instance!
 
Method Summary
static Instance getInstance()
          Creates and returns an instance of this class which addresses the current DB2 Instance.
 java.lang.String getInstanceName()
          Returns the DB2 Instance name (from the oInstanceName field).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

oInstanceName

protected java.lang.String oInstanceName
Field holding the name of the DB2 instance, which is addressed by the instance of this class.
Constructor Detail

Instance

public Instance()
         throws UnknownValueException
Creates a new instance of this class and addressed the current DB2 Instance.

Background: This constructor calls a private method which interprets the value returned by java.lang.System.getProperty("DB2INSTANCE");
Throws:
UnknownValueException - For the case, that the name of the current DB2 Instance could not be detected.

Instance

public Instance(java.lang.String oInstanceName)
         throws java.lang.NullPointerException
Creates a new instance of this class - addressing the provided DB2 Instance name.

Remark: Please notice, the constructor does not check for the existence of the given DB2 instance!
Parameters:
oInstanceName - The name of the DB2 Instance to be addressed.
Throws:
java.lang.NullPointerException - If the oInstanceName argument was null.
Method Detail

getInstance

public static Instance getInstance()
                            throws UnknownValueException
Creates and returns an instance of this class which addresses the current DB2 Instance.
Returns:
The Instance object addressing the current DB2 Instance.
Throws:
UnknownValueException - For the case, that the name of the current DB2 Instance could not be detected.

getInstanceName

public java.lang.String getInstanceName()
Returns the DB2 Instance name (from the oInstanceName field).
Returns:
A new String, containing the DB2 Instance name.

DbtuTools project
Java Library