Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jasig.portal.rdbm
Class DatabaseMetaDataImpl

    java.lang.Object
      org.jasig.portal.rdbm.DatabaseMetaDataImpl

All Implemented Interfaces:
  IDatabaseMetadata

    public class DatabaseMetaDataImpl

extends java.lang.Object
implements IDatabaseMetadata

Version:
  $Revision: 1.3.2.3 $ $Date: 2006/02/28 22:56:51 $
Author:
  Eric Dalquist edalquist@unicon.net

Nested Class Summary
`static class` | `DatabaseMetaDataImpl.JdbcDb`
`static class` | `DatabaseMetaDataImpl.OracleDb`
`static class` | `DatabaseMetaDataImpl.PostgreSQLDb`

Field Summary
`private java.lang.String` | `databaseProductName`
`private java.lang.String` | `databaseProductVersion`
`private javax.sql.DataSource` | `dataSource` The `DataSource` that represents the server
`private java.lang.String` | `dbUrl`
`private java.lang.String` | `driverName`
`private java.lang.String` | `driverVersion`
`private static JoinQueryString` | `jdbcDb`
`private IJoinQueryString` | `joinTest` The `IJoinQueryString` to use for performing outer joins
`private static JoinQueryString[]` | `joinTests` Array of join tests to perform.
`private static org.apache.commons.logging.Log` | `LOG`
`private static JoinQueryString` | `oracleDb`
`private static JoinQueryString` | `postgreSQLDb`
`private boolean` | `supportsPreparedStatements`
`private boolean` | `supportsTransactions`
`private static java.text.SimpleDateFormat` | `TO_DATE_FORMAT` Define the oracle TO_DATE format
`private java.lang.String` | `transactionTestMsg`
`private java.lang.String` | `userName`
`private boolean` | `useToDate`
`private boolean` | `useTSWrapper`

Constructor Summary
`DatabaseMetaDataImpl(javax.sql.DataSource ds)` Creates a new `DatabaseMetaDataImpl` with the specified `DataSource`.

Method Summary
`IJoinQueryString` | `getJoinQuery()` Gets the appropriate `IJoinQueryString` implemenation for the database.
`private void` | `getMetaData(java.sql.Connection conn)` Gets meta data about the connection.
`void` | `releaseConnection(java.sql.Connection conn)`
`private void` | `runDatabaseTests()` Run a set of tests on the database to provide better meta data.
`java.lang.String` | `sqlTimeStamp()` SQL TimeStamp format of current time.
`java.lang.String` | `sqlTimeStamp(java.util.Date date)` SQL TimeStamp format a Date.
`java.lang.String` | `sqlTimeStamp(long date)` SQL TimeStamp format a long.
`boolean` | `supportsOuterJoins()` Returns `true` if the database server supports outer joins.
`boolean` | `supportsPreparedStatements()` Returns `true` if the database server supports prepared statements.
`boolean` | `supportsTransactions()` Returns `true` if the database server supports transactions.
`private void` | `testOuterJoins(java.sql.Connection conn)` Test the database to see if it really supports outer joins.
`private void` | `testPreparedStatements(java.sql.Connection conn)` Tests the database for prepared statement support.
`private void` | `testTimeStamp(java.sql.Connection conn)` Test the database to find the supported timestamp format
`private void` | `testTransactions(java.sql.Connection conn)` Test the database to see if it really supports transactions
`java.lang.String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### LOG

    private static final org.apache.commons.logging.Log LOG

### TO_DATE_FORMAT

    private static final java.text.SimpleDateFormat TO_DATE_FORMAT

  Define the oracle TO_DATE format

### jdbcDb

    private static final JoinQueryString jdbcDb

### postgreSQLDb

    private static final JoinQueryString postgreSQLDb

### oracleDb

    private static final JoinQueryString oracleDb

### joinTests

    private static final JoinQueryString[] joinTests

  Array of join tests to perform.

### dataSource

    private final javax.sql.DataSource dataSource

  The `DataSource` that represents the server

### joinTest

    private IJoinQueryString joinTest

  The `IJoinQueryString` to use for performing outer joins

### useTSWrapper

    private boolean useTSWrapper

### useToDate

    private boolean useToDate

### supportsTransactions

    private boolean supportsTransactions

### supportsPreparedStatements

    private boolean supportsPreparedStatements

### transactionTestMsg

    private java.lang.String transactionTestMsg

### databaseProductName

    private java.lang.String databaseProductName

### databaseProductVersion

    private java.lang.String databaseProductVersion

### driverName

    private java.lang.String driverName

### driverVersion

    private java.lang.String driverVersion

### userName

    private java.lang.String userName

### dbUrl

    private java.lang.String dbUrl

Constructor Detail

### DatabaseMetaDataImpl

    public DatabaseMetaDataImpl(javax.sql.DataSource ds)

  Creates a new `DatabaseMetaDataImpl` with the specified `DataSource`.

  Parameters:
    `ds` - The `DataSource` to use as the base for this server interface.

Method Detail

### releaseConnection

    public void releaseConnection(java.sql.Connection conn)

  See Also:
    `org.jasig.portal.rdbm.IDatabaseServer#releaseConnection(java.sql.Connection)`

### getJoinQuery

    public final IJoinQueryString getJoinQuery()

  Description copied from interface: `IDatabaseMetadata`
  Gets the appropriate `IJoinQueryString` implemenation for the database. If `IDatabaseMetadata.supportsOuterJoins()` returns `false` this will return `null`.

  Specified by:
    `getJoinQuery` in interface `IDatabaseMetadata`
  Returns:
    The appropriate `IJoinQueryString` implemenation.
  See Also:
    `org.jasig.portal.rdbm.IDatabaseServer#getJoinQuery()`

### supportsOuterJoins

    public final boolean supportsOuterJoins()

  Description copied from interface: `IDatabaseMetadata`
  Returns `true` if the database server supports outer joins. The query to use if this returns `true` can be retrieved from the `IDatabaseMetadata.getJoinQuery()` method.

  Specified by:
    `supportsOuterJoins` in interface `IDatabaseMetadata`
  Returns:
    `true` if the server supports outer joins.
  See Also:
    `org.jasig.portal.rdbm.IDatabaseServer#supportsOuterJoins()`

### supportsTransactions

    public final boolean supportsTransactions()

  Description copied from interface: `IDatabaseMetadata`
  Returns `true` if the database server supports transactions.

  Specified by:
    `supportsTransactions` in interface `IDatabaseMetadata`
  Returns:
    `true` if the server supports transactions.
  See Also:
    `org.jasig.portal.rdbm.IDatabaseServer#supportsTransactions()`

### supportsPreparedStatements

    public final boolean supportsPreparedStatements()

  Description copied from interface: `IDatabaseMetadata`
  Returns `true` if the database server supports prepared statements.

  Specified by:
    `supportsPreparedStatements` in interface `IDatabaseMetadata`
  Returns:
    `true` if the server supports prepared statements.
  See Also:
    `org.jasig.portal.rdbm.IDatabaseServer#supportsPreparedStatements()`

### sqlTimeStamp

    public java.lang.String sqlTimeStamp()

  Description copied from interface: `IDatabaseMetadata`
  SQL TimeStamp format of current time.

  Specified by:
    `sqlTimeStamp` in interface `IDatabaseMetadata`
  Returns:
    SQL TimeStamp of the current time.
  See Also:
    `org.jasig.portal.rdbm.IDatabaseServer#sqlTimeStamp()`

### sqlTimeStamp

    public java.lang.String sqlTimeStamp(long date)

  Description copied from interface: `IDatabaseMetadata`
  SQL TimeStamp format a long.

  Specified by:
    `sqlTimeStamp` in interface `IDatabaseMetadata`
  Parameters:
    `date` - The time in milliseconds to format.
  Returns:
    SQL TimeStamp of the specified time.
  See Also:
    `org.jasig.portal.rdbm.IDatabaseServer#sqlTimeStamp(long)`

### sqlTimeStamp

    public java.lang.String sqlTimeStamp(java.util.Date date)

  Description copied from interface: `IDatabaseMetadata`
  SQL TimeStamp format a Date.

  Specified by:
    `sqlTimeStamp` in interface `IDatabaseMetadata`
  Parameters:
    `date` - The date to format.
  Returns:
    SQL TimeStamp or "NULL" if date is null.
  See Also:
    `org.jasig.portal.rdbm.IDatabaseServer#sqlTimeStamp(java.util.Date)`

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

### runDatabaseTests

    private void runDatabaseTests()

  Run a set of tests on the database to provide better meta data.

### getMetaData

    private void getMetaData(java.sql.Connection conn)

  Gets meta data about the connection.

  Parameters:
    `conn` - The connection to use.

### testPreparedStatements

    private void testPreparedStatements(java.sql.Connection conn)

  Tests the database for prepared statement support.

  Parameters:
    `conn` - The connection to use.

### testOuterJoins

    private void testOuterJoins(java.sql.Connection conn)

  Test the database to see if it really supports outer joins.

  Parameters:
    `conn` - The connection to use.

### testTimeStamp

    private void testTimeStamp(java.sql.Connection conn)

  Test the database to find the supported timestamp format

  Parameters:
    `conn` - The connection to use.

### testTransactions

    private void testTransactions(java.sql.Connection conn)

  Test the database to see if it really supports transactions

  Parameters:
    `conn` - The connection to use.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD