pt.moredata.dao.util
Class DataBaseIdentifier

java.lang.Object
  extended bypt.moredata.dao.util.DataBaseIdentifier

public class DataBaseIdentifier
extends java.lang.Object

This class identifies a DtaSource giveen a pt.moredata.dao.DataSource. Company MoreData

Version:
$Revision: 1.5 $
Author:
pcarmo

Field Summary
static int INFORMIX_DATABASE
          Informix data base.
static int MYSQL_DATABASE
          MySQL database.
static int ORACLE_DATABASE
          Oracle database.
static int POSTGRESQL_DATABASE
          PostgreSQL database.
static int SERIALIZED_FILE
           
static int UNKNOWN_DATABASE
          Unknown database.
 
Method Summary
 int getIdentification(java.sql.Connection connection)
          Identifies a Database from a Connection object.
 int getIdentification(DataSource dataSource)
          Identifies a Database from a DataSource object.
 java.lang.String getName(DataSource dataSource)
          Identifies the name of the Database from a DataSource object.
static DataBaseIdentifier instance()
          Devolve a instancia (singleton) do DataBaseIdentifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNKNOWN_DATABASE

public static final int UNKNOWN_DATABASE
Unknown database.

See Also:
Constant Field Values

SERIALIZED_FILE

public static final int SERIALIZED_FILE
See Also:
Constant Field Values

INFORMIX_DATABASE

public static final int INFORMIX_DATABASE
Informix data base.

See Also:
Constant Field Values

ORACLE_DATABASE

public static final int ORACLE_DATABASE
Oracle database.

See Also:
Constant Field Values

MYSQL_DATABASE

public static final int MYSQL_DATABASE
MySQL database.

See Also:
Constant Field Values

POSTGRESQL_DATABASE

public static final int POSTGRESQL_DATABASE
PostgreSQL database.

See Also:
Constant Field Values
Method Detail

instance

public static DataBaseIdentifier instance()
Devolve a instancia (singleton) do DataBaseIdentifier.

Returns:
A instancia (singleton) do DataBaseIdentifier.

getIdentification

public int getIdentification(DataSource dataSource)
Identifies a Database from a DataSource object.

Parameters:
dataSource - The DataSource object.
Returns:
The identification of the DataSource or UNKNOWN_DATABASE if the database is unknown.

getIdentification

public int getIdentification(java.sql.Connection connection)
Identifies a Database from a Connection object.

Parameters:
connection - The database connection.
Returns:
The identification of the database or UNKNOWN_DATABASE if the database is unknown.

getName

public java.lang.String getName(DataSource dataSource)
Identifies the name of the Database from a DataSource object.

Parameters:
dataSource - The DataSource object.
Returns:
A name for the DataSource.