com.triactive.jdo.store.adapter
Class DatabaseIdentifier

java.lang.Object
  extended bycom.triactive.jdo.store.adapter.DatabaseIdentifier
Direct Known Subclasses:
DatabaseIdentifierJdbc2, DatabaseIdentifierJdbc3

public class DatabaseIdentifier
extends java.lang.Object

Represents identifying information for a particular database and driver.

A database identifier is mostly just a container for the following values obtained from DatabaseMetaData:

 getDatabaseProductName()
 getDatabaseProductVersion()
 getDatabaseMajorVersion()
 getDatabaseMinorVersion()
 getDriverName()
 getDriverVersion()
 

An identifier can also be used as a pattern used for matching against other identifiers. In that case, the four string values (product name/version, driver name/version) are interpreted as regular expressions, or can be null to indicate "match any value".

Author:
Mike Martin

Field Summary
 java.lang.String driverName
           
 java.lang.String driverVersion
           
 int productMajorVersion
           
 int productMinorVersion
           
 java.lang.String productName
           
 java.lang.String productVersion
           
 
Constructor Summary
DatabaseIdentifier(java.lang.String productName)
           
DatabaseIdentifier(java.lang.String productName, java.lang.String productVersion, int productMajorVersion, int productMinorVersion, java.lang.String driverName, java.lang.String driverVersion)
           
DatabaseIdentifier(java.lang.String productName, java.lang.String productVersion, java.lang.String driverName, java.lang.String driverVersion)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
static DatabaseIdentifier forDatabase(java.sql.DatabaseMetaData dmd)
           
 int hashCode()
           
 boolean matches(DatabaseIdentifier patterns)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

productName

public final java.lang.String productName

productVersion

public final java.lang.String productVersion

productMajorVersion

public final int productMajorVersion

productMinorVersion

public final int productMinorVersion

driverName

public final java.lang.String driverName

driverVersion

public final java.lang.String driverVersion
Constructor Detail

DatabaseIdentifier

public DatabaseIdentifier(java.lang.String productName)

DatabaseIdentifier

public DatabaseIdentifier(java.lang.String productName,
                          java.lang.String productVersion,
                          java.lang.String driverName,
                          java.lang.String driverVersion)

DatabaseIdentifier

public DatabaseIdentifier(java.lang.String productName,
                          java.lang.String productVersion,
                          int productMajorVersion,
                          int productMinorVersion,
                          java.lang.String driverName,
                          java.lang.String driverVersion)
Method Detail

forDatabase

public static DatabaseIdentifier forDatabase(java.sql.DatabaseMetaData dmd)
                                      throws java.sql.SQLException
Throws:
java.sql.SQLException

matches

public boolean matches(DatabaseIdentifier patterns)

hashCode

public int hashCode()

equals

public boolean equals(java.lang.Object o)

toString

public java.lang.String toString()


Copyright 2001-2007 The TJDO Project All Rights Reserved.