org.synchronoss.cpo.jdbc
Class JndiDataSourceInfo

Package class diagram package JndiDataSourceInfo
java.lang.Object
  extended by org.synchronoss.cpo.jdbc.JndiDataSourceInfo
All Implemented Interfaces:
DataSourceInfo

public class JndiDataSourceInfo
extends java.lang.Object
implements DataSourceInfo

Collects the info required to instantiate a DataSource stored as a JNDI Resource. Provides the DataSourceInfo factory method getDataSource which instantiates the DataSource

Author:
dberry

Constructor Summary
JndiDataSourceInfo(java.lang.String jndiName)
          Creates a JndiDataSourceInfo from a JNDIName that represents the datasource in the application server.
JndiDataSourceInfo(java.lang.String jndiName, javax.naming.Context ctx)
          Creates a JndiDataSourceInfo from a JNDIName that represents the datasource in the application server.
JndiDataSourceInfo(java.lang.String jndiName, javax.naming.Context ctx, java.lang.String tablePrefix)
          Creates a JndiDataSourceInfo from a JNDIName that represents the datasource in the application server.
JndiDataSourceInfo(java.lang.String jndiName, java.lang.String tablePrefix)
          Creates a JndiDataSourceInfo from a JNDIName that represents the datasource in the application server.
 
Method Summary
 javax.sql.DataSource getDataSource()
           
 java.lang.String getDataSourceName()
           
 java.lang.String getTablePrefix()
          Returns the tablePrefix or an empty string if no table prefix exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JndiDataSourceInfo

public JndiDataSourceInfo(java.lang.String jndiName)
Creates a JndiDataSourceInfo from a JNDIName that represents the datasource in the application server.

Parameters:
jndiName - The JndiName of the app server datasource

JndiDataSourceInfo

public JndiDataSourceInfo(java.lang.String jndiName,
                          java.lang.String tablePrefix)
Creates a JndiDataSourceInfo from a JNDIName that represents the datasource in the application server.

Parameters:
jndiName - The JndiName of the app server datasource

JndiDataSourceInfo

public JndiDataSourceInfo(java.lang.String jndiName,
                          javax.naming.Context ctx)
Creates a JndiDataSourceInfo from a JNDIName that represents the datasource in the application server.

Parameters:
jndiName - The JndiName of the app server datasource
ctx - - The context for which the Jndi Lookup should use.

JndiDataSourceInfo

public JndiDataSourceInfo(java.lang.String jndiName,
                          javax.naming.Context ctx,
                          java.lang.String tablePrefix)
Creates a JndiDataSourceInfo from a JNDIName that represents the datasource in the application server.

Parameters:
jndiName - The JndiName of the app server datasource
ctx - - The context for which the Jndi Lookup should use.
Method Detail

getDataSourceName

public java.lang.String getDataSourceName()
Specified by:
getDataSourceName in interface DataSourceInfo
Returns:
Returns the dataSourceName.

getTablePrefix

public java.lang.String getTablePrefix()
Description copied from interface: DataSourceInfo
Returns the tablePrefix or an empty string if no table prefix exists.

Specified by:
getTablePrefix in interface DataSourceInfo
Returns:
Returns the tablePrefix to be used on the CPO Tables

getDataSource

public javax.sql.DataSource getDataSource()
                                   throws CpoException
Specified by:
getDataSource in interface DataSourceInfo
Returns:
Returns the DataSource
Throws:
CpoException


Copyright © 2011. All Rights Reserved.