toolkit.db.api
Class ConnectionInfo

java.lang.Object
  extended by toolkit.db.api.ConnectionInfo

public class ConnectionInfo
extends java.lang.Object

Class ConnectionInfo wraps all information used to create the connection to a database by JDBC driver.


Field Summary
static int ENCODING_AUTO
           
static int ENCODING_NO
           
static int ENCODING_YES
           
static int EXTRA_NAME_JDBC
           
static int EXTRA_NAME_USERDEFINED
           
static int READ_ONLY_DEFAULT
           
static int READ_ONLY_FALSE
           
static int READ_ONLY_TRUE
           
static int TABLE_QUALIFIED_PATTERN_THREE_PARTS
           
static int TABLE_QUALIFIED_PATTERN_TWO_PARTS
           
static int TABLE_QUALIFIED_PATTERN_UNQUALIFIED
           
static int TRANSACTION_DEFAULT
           
static int TRANSACTION_NONE
           
static int TRANSACTION_READ_COMMITTED
           
static int TRANSACTION_READ_UNCOMMITTED
           
static int TRANSACTION_REPEATABLE_READ
           
static int TRANSACTION_SERIALIZABLE
           
 
Constructor Summary
ConnectionInfo(java.lang.String sDriver, java.lang.String sURL, java.lang.String sUser, java.lang.String sPassword, java.lang.String sDateFormat, java.lang.String sTimeFormat, java.lang.String sTimestampFormat, int iTransactionIsolation, int iReadOnly, int iQualifiedNamePattern, int iExtraNamePattern, int iEncodingPattern)
          Constructs a ConnectionInfo with the specified parameters.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares this ConnectionInfo to the specified object.
 java.lang.String getDateFormat()
          Gets the format of Date type.
 java.lang.String getDriver()
          Gets the jdbc driver name.
 int getEncodingPattern()
          Gets the encoding option when getting the string from ResultSet.
 int getExtraNamePattern()
          Gets the qualified name pattern.
 java.lang.String getPassword()
          Gets the user's password.
 int getQualifiedNamePattern()
          Gets the qualified pattern of the table name.
 int getReadOnly()
          Gets the read-only property of the connection.
 java.lang.String getTimeFormat()
          Gets the format of Time type.
 java.lang.String getTimestampFormat()
          Gets the format of Timestemp type.
 int getTransactionIsolation()
          Gets the transaction level of the connection.
 java.lang.String getURL()
          Gets the jdbc URL.
 java.lang.String getUser()
          Gets the user name used to connect to the database.
 java.lang.String toString()
          Returns a string representing this ConnectionInfo's values.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TRANSACTION_DEFAULT

public static final int TRANSACTION_DEFAULT
See Also:
Constant Field Values

TRANSACTION_NONE

public static final int TRANSACTION_NONE
See Also:
Constant Field Values

TRANSACTION_READ_UNCOMMITTED

public static final int TRANSACTION_READ_UNCOMMITTED
See Also:
Constant Field Values

TRANSACTION_READ_COMMITTED

public static final int TRANSACTION_READ_COMMITTED
See Also:
Constant Field Values

TRANSACTION_REPEATABLE_READ

public static final int TRANSACTION_REPEATABLE_READ
See Also:
Constant Field Values

TRANSACTION_SERIALIZABLE

public static final int TRANSACTION_SERIALIZABLE
See Also:
Constant Field Values

READ_ONLY_DEFAULT

public static final int READ_ONLY_DEFAULT
See Also:
Constant Field Values

READ_ONLY_TRUE

public static final int READ_ONLY_TRUE
See Also:
Constant Field Values

READ_ONLY_FALSE

public static final int READ_ONLY_FALSE
See Also:
Constant Field Values

TABLE_QUALIFIED_PATTERN_UNQUALIFIED

public static final int TABLE_QUALIFIED_PATTERN_UNQUALIFIED
See Also:
Constant Field Values

TABLE_QUALIFIED_PATTERN_TWO_PARTS

public static final int TABLE_QUALIFIED_PATTERN_TWO_PARTS
See Also:
Constant Field Values

TABLE_QUALIFIED_PATTERN_THREE_PARTS

public static final int TABLE_QUALIFIED_PATTERN_THREE_PARTS
See Also:
Constant Field Values

EXTRA_NAME_JDBC

public static final int EXTRA_NAME_JDBC
See Also:
Constant Field Values

EXTRA_NAME_USERDEFINED

public static final int EXTRA_NAME_USERDEFINED
See Also:
Constant Field Values

ENCODING_AUTO

public static final int ENCODING_AUTO
See Also:
Constant Field Values

ENCODING_YES

public static final int ENCODING_YES
See Also:
Constant Field Values

ENCODING_NO

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

ConnectionInfo

public ConnectionInfo(java.lang.String sDriver,
                      java.lang.String sURL,
                      java.lang.String sUser,
                      java.lang.String sPassword,
                      java.lang.String sDateFormat,
                      java.lang.String sTimeFormat,
                      java.lang.String sTimestampFormat,
                      int iTransactionIsolation,
                      int iReadOnly,
                      int iQualifiedNamePattern,
                      int iExtraNamePattern,
                      int iEncodingPattern)
Constructs a ConnectionInfo with the specified parameters.

Parameters:
sDriver - Name of the driver used to connect to the database.
sURL - A jdbc url.
sUser - User name used to connect to the database.
sPassword - User's password.
sDateFormat - Format of Date type. It should be a valid java date pattern and work well in this db.
sTimeFormat - Format of Time type. It should be a valid java time pattern and work well in this db.
sTimestampFormat - Format of TimeStamp type. It should be a valid java date and time pattern and work well in this db.
iTransactionIsolation - Transaction level of the connection. The valid value is defined at java.sql.Connection.
iReadOnly - Read only property of the connection.
iQualifiedNamePattern - Qualified pattern of the table name.
iExtraNamePattern - Qualified name pattern.
iEncodingPattern - Encoding option when getting string from ResultSet.
See Also:
java.text.SimpleDateFormat, java.sql.Connection
Method Detail

getDriver

public java.lang.String getDriver()
Gets the jdbc driver name.

Returns:
the jdbd driver name.

getURL

public java.lang.String getURL()
Gets the jdbc URL.

Returns:
the jdbd URL.

getUser

public java.lang.String getUser()
Gets the user name used to connect to the database.

Returns:
the user name.

getPassword

public java.lang.String getPassword()
Gets the user's password.

Returns:
the user's password.

getDateFormat

public java.lang.String getDateFormat()
Gets the format of Date type.

Returns:
the format of Date type.

getTimeFormat

public java.lang.String getTimeFormat()
Gets the format of Time type.

Returns:
the format of Time type.

getTimestampFormat

public java.lang.String getTimestampFormat()
Gets the format of Timestemp type.

Returns:
the format of Timestemp type.

getTransactionIsolation

public int getTransactionIsolation()
Gets the transaction level of the connection. The valid value sould be TRANSACTION_XXXX.

Returns:
the transaction level of the connection.

getReadOnly

public int getReadOnly()
Gets the read-only property of the connection. The valid value sould be READ_ONLY_XXXX.

Returns:
the read-only property of the connection.

getQualifiedNamePattern

public int getQualifiedNamePattern()
Gets the qualified pattern of the table name. The valid value sould be TABLE_QUALIFIED_PATTERN_XXXX.

Returns:
the qualified pattern of the table name.

getExtraNamePattern

public int getExtraNamePattern()
Gets the qualified name pattern. The valid value sould be EXTRA_NAME_XXXX.

Returns:
the qualified name pattern.

getEncodingPattern

public int getEncodingPattern()
Gets the encoding option when getting the string from ResultSet. The valid value sould be ENCODING_XXXX.

Returns:
encoding option when getting the string from ResultSet.

equals

public boolean equals(java.lang.Object obj)
Compares this ConnectionInfo to the specified object.

Overrides:
equals in class java.lang.Object
Returns:
true if the ConnectionInfo are the same, false otherwise.

toString

public java.lang.String toString()
Returns a string representing this ConnectionInfo's values. The format is as follows:

  className@hashCode[ driver | URL | user | password | 
                      dateFromat | timeFormat | timestampFromat | 
                      transactionLevelString | isReadOnly | 
                      tableQualifyOption | extraNamePattern | 
                      encodingPattern ]
        

Overrides:
toString in class java.lang.Object
Returns:
a string representing this AndInfo.