实现一个自定义的数据库连接池(未完成)

master
星期八 5 years ago
parent f8744c4e68
commit 88d75d3e6f
  1. 111
      panda-jdbc/src/main/java/org/panda/jdbc/pool/JdbcPool.java

@ -0,0 +1,111 @@
package org.panda.jdbc.pool;
import javax.sql.DataSource;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.util.logging.Logger;
/**
* @Author: qi
* @Description:自定义数据库连接池
* @Date: Create in 9:54 AM 2019/8/14
*/
public class JdbcPool implements DataSource {
/**
* 获取连接
* @return
* @throws SQLException
*/
@Override
public Connection getConnection() throws SQLException {
return null;
}
/**
* 获取连接
* @param username
* @param password
* @return
* @throws SQLException
*/
@Override
public Connection getConnection(String username, String password) throws SQLException {
return null;
}
/**
* 拆开
* @param iface
* @param <T>
* @return
* @throws SQLException
*/
@Override
public <T> T unwrap(Class<T> iface) throws SQLException {
return null;
}
/**
* 是否包装
* @param iface
* @return
* @throws SQLException
*/
@Override
public boolean isWrapperFor(Class<?> iface) throws SQLException {
return false;
}
/**
* 获取日志编写器
* @return
* @throws SQLException
*/
@Override
public PrintWriter getLogWriter() throws SQLException {
return null;
}
/**
* 设置日志编写器
* @param out
* @throws SQLException
*/
@Override
public void setLogWriter(PrintWriter out) throws SQLException {
}
/**
* 设置逻辑超时
* @param seconds
* @throws SQLException
*/
@Override
public void setLoginTimeout(int seconds) throws SQLException {
}
/**
* 获取登录超时
* @return
* @throws SQLException
*/
@Override
public int getLoginTimeout() throws SQLException {
return 0;
}
/**
* 获取父记录器
* @return
* @throws SQLFeatureNotSupportedException
*/
@Override
public Logger getParentLogger() throws SQLFeatureNotSupportedException {
return null;
}
}
Loading…
Cancel
Save