Files
Druid/src/main/java/com/alibaba/druid/pool/DataSourceAdapter.java
T
2011-11-16 14:07:08 +08:00

54 lines
1.3 KiB
Java

package com.alibaba.druid.pool;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.util.logging.Logger;
import javax.sql.DataSource;
public class DataSourceAdapter extends WrapperAdapter implements DataSource {
private int loginTimeout = 0;
private PrintWriter logWriter = new PrintWriter(System.out);
public DataSourceAdapter(){
}
@Override
public PrintWriter getLogWriter() throws SQLException {
return logWriter;
}
@Override
public void setLogWriter(PrintWriter out) throws SQLException {
this.logWriter = out;
}
@Override
public void setLoginTimeout(int seconds) throws SQLException {
loginTimeout = seconds;
}
@Override
public int getLoginTimeout() throws SQLException {
return loginTimeout;
}
@Override
public Connection getConnection() throws SQLException {
throw new UnsupportedOperationException();
}
@Override
public Connection getConnection(String username, String password) throws SQLException {
throw new UnsupportedOperationException();
}
public Logger getParentLogger() throws SQLFeatureNotSupportedException {
throw new SQLFeatureNotSupportedException();
}
}