public static DataSource createDataSource(Properties properties,Context context) throws Exception {
PoolConfiguration poolProperties = DataSourceFactory.parsePoolProperties(properties);
if (poolProperties.getDataSourceJNDI()!=null && poolProperties.getDataSource()==null) {
- javax.sql.CommonDataSource jndiDS = null;
+ Object jndiDS = null;
try {
if (context!=null) {
- jndiDS = (javax.sql.CommonDataSource)context.lookup(poolProperties.getDataSourceJNDI());
+ jndiDS = context.lookup(poolProperties.getDataSourceJNDI());
} else {
log.warn("dataSourceJNDI property is configued, but local JNDI context is null.");
}
if (jndiDS==null) {
try {
context = (Context) (new InitialContext());
- jndiDS = (javax.sql.CommonDataSource)context.lookup(poolProperties.getDataSourceJNDI());
+ jndiDS = context.lookup(poolProperties.getDataSourceJNDI());
} catch (NamingException e) {
log.warn("The name \""+poolProperties.getDataSourceJNDI()+"\" can not be found in the InitialContext.");
}
import java.util.Properties;
import java.util.concurrent.Future;
-import javax.sql.CommonDataSource;
import javax.sql.XAConnection;
import org.apache.juli.logging.Log;
/**
* {@inheritDoc}
*/
- public void setDataSource(javax.sql.CommonDataSource ds) {
+ public void setDataSource(Object ds) {
getPoolProperties().setDataSource(ds);
}
/**
* {@inheritDoc}
*/
- public CommonDataSource getDataSource() {
+ public Object getDataSource() {
return getPoolProperties().getDataSource();
}
import java.util.Properties;
-import javax.sql.CommonDataSource;
-
import org.apache.tomcat.jdbc.pool.PoolProperties.InterceptorDefinition;
/**
* will be invoked.
* @param ds the {@link javax.sql.DataSource} to be used for creating connections to be pooled.
*/
- public void setDataSource(CommonDataSource ds);
+ public void setDataSource(Object ds);
/**
* Returns a datasource, if one exists that is being used to create connections.
* This method will return null if the pool is using a {@link java.sql.Driver}
* @return the {@link javax.sql.DataSource} to be used for creating connections to be pooled or null if a Driver is used.
*/
- public CommonDataSource getDataSource();
+ public Object getDataSource();
/**
* Configure the connection pool to use a DataSource according to {@link PoolConfiguration#setDataSource(CommonDataSource)}
import java.util.Properties;
import java.util.concurrent.atomic.AtomicInteger;
-import javax.sql.CommonDataSource;
import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
protected boolean useLock = false;
protected InterceptorDefinition[] interceptors = null;
protected int suspectTimeout = 0;
- protected javax.sql.CommonDataSource dataSource = null;
+ protected Object dataSource = null;
protected String dataSourceJNDI = null;
/**
* {@inheritDoc}
*/
- public void setDataSource(javax.sql.CommonDataSource ds) {
+ public void setDataSource(Object ds) {
this.dataSource = ds;
}
/**
* {@inheritDoc}
*/
- public CommonDataSource getDataSource() {
+ public Object getDataSource() {
return dataSource;
}
import javax.management.Notification;
import javax.management.NotificationBroadcasterSupport;
import javax.management.NotificationListener;
-import javax.sql.CommonDataSource;
import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
- @Override
+
public MBeanNotificationInfo[] getNotificationInfo() {
MBeanNotificationInfo[] pres = super.getNotificationInfo();
MBeanNotificationInfo[] loc = getDefaultNotificationInfo();
public void setDriverClassName(String driverClassName) {
getPoolProperties().setDriverClassName(driverClassName);
}
-
+
+ @Override
public void setFairQueue(boolean fairQueue) {
getPoolProperties().setFairQueue(fairQueue);
}
}
- @Override
+ @Override
public void setMaxIdle(int maxIdle) {
// TODO Auto-generated method stub
/**
* {@inheritDoc}
*/
- public void setDataSource(javax.sql.CommonDataSource ds) {
+ public void setDataSource(Object ds) {
getPoolProperties().setDataSource(ds);
}
/**
* {@inheritDoc}
*/
- public CommonDataSource getDataSource() {
+ public Object getDataSource() {
return getPoolProperties().getDataSource();
}