org.jasig.portal.rdbm
Class DatabaseMetaDataImpl

java.lang.Object
  extended by org.jasig.portal.rdbm.DatabaseMetaDataImpl
All Implemented Interfaces:
IDatabaseMetadata, InitializingBean

public class DatabaseMetaDataImpl
extends Object
implements IDatabaseMetadata, InitializingBean

Version:
$Revision: 19776 $ $Date: 2010-01-14 16:17:21 -0600 (Thu, 14 Jan 2010) $
Author:
Eric Dalquist edalquist@unicon.net

Nested Class Summary
static class DatabaseMetaDataImpl.JdbcDb
           
static class DatabaseMetaDataImpl.OracleDb
           
static class DatabaseMetaDataImpl.PostgreSQLDb
           
 
Constructor Summary
DatabaseMetaDataImpl(DataSource ds, PlatformTransactionManager transactionManager)
          Creates a new DatabaseMetaDataImpl with the specified DataSource.
 
Method Summary
 void afterPropertiesSet()
           
 String getDatabaseProductName()
           
 String getDatabaseProductVersion()
           
 String getJdbcDriver()
           
 String getJdbcDriverVersion()
           
 String getJdbcUrl()
           
 String getJdbcUser()
           
 IJoinQueryString getJoinQuery()
          Gets the appropriate IJoinQueryString implemenation for the database.
 String sqlTimeStamp()
          SQL TimeStamp format of current time.
 String sqlTimeStamp(Date date)
          SQL TimeStamp format a Date.
 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.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DatabaseMetaDataImpl

public DatabaseMetaDataImpl(DataSource ds,
                            PlatformTransactionManager transactionManager)
Creates a new DatabaseMetaDataImpl with the specified DataSource.

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

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

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:
IDatabaseMetadata.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:
IDatabaseMetadata.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:
IDatabaseMetadata.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:
IDatabaseMetadata.supportsPreparedStatements()

getJdbcDriver

public String getJdbcDriver()
Specified by:
getJdbcDriver in interface IDatabaseMetadata
Returns:
The JDBC Driver being used

getDatabaseProductName

public String getDatabaseProductName()
Specified by:
getDatabaseProductName in interface IDatabaseMetadata
Returns:
Database Name

getDatabaseProductVersion

public String getDatabaseProductVersion()
Specified by:
getDatabaseProductVersion in interface IDatabaseMetadata
Returns:
Database Version

getJdbcDriverVersion

public String getJdbcDriverVersion()
Specified by:
getJdbcDriverVersion in interface IDatabaseMetadata
Returns:
The JDBC Driver version

getJdbcUrl

public String getJdbcUrl()
Specified by:
getJdbcUrl in interface IDatabaseMetadata
Returns:
The JDBC URL being used

getJdbcUser

public String getJdbcUser()
Specified by:
getJdbcUser in interface IDatabaseMetadata
Returns:
The JDBC user name

sqlTimeStamp

public 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:
IDatabaseMetadata.sqlTimeStamp()

sqlTimeStamp

public 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:
IDatabaseMetadata.sqlTimeStamp(long)

sqlTimeStamp

public String sqlTimeStamp(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:
IDatabaseMetadata.sqlTimeStamp(java.util.Date)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2010 Jasig. All Rights Reserved.