mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
55 lines
1.2 KiB
Java
55 lines
1.2 KiB
Java
package com.alibaba.druid.ha;
|
|
|
|
import java.io.PrintWriter;
|
|
import java.sql.Connection;
|
|
import java.sql.SQLException;
|
|
|
|
import javax.sql.DataSource;
|
|
|
|
public class HADataSource implements DataSource {
|
|
|
|
private int loginTimeout = 0;
|
|
private PrintWriter logWriter = new PrintWriter(System.out);
|
|
|
|
@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 <T> T unwrap(Class<T> iface) throws SQLException {
|
|
return null;
|
|
}
|
|
|
|
@Override
|
|
public boolean isWrapperFor(Class<?> iface) throws SQLException {
|
|
return false;
|
|
}
|
|
|
|
@Override
|
|
public Connection getConnection() throws SQLException {
|
|
return null;
|
|
}
|
|
|
|
@Override
|
|
public Connection getConnection(String username, String password) throws SQLException {
|
|
return null;
|
|
}
|
|
|
|
}
|