mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
54 lines
1.3 KiB
Java
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();
|
|
}
|
|
|
|
}
|