一聚教程网:一个值得你收藏的教程网站

热门教程

连接数据池

时间:2022-07-02 18:17:25 编辑:袖梨 来源:一聚教程网

类中
public class InterfaceFactory {
OutBoundDbConnection outboundDbConnection = null;
public OutBoundDbConnection getOutboundDbConnection()
throws
InstantiationException,
IllegalAccessException,
ClassNotFoundException {
outboundDbConnection =
(OutBoundDbConnection) Class
.forName("com.isoftstone.struts.biz.dao.ConnData")
.newInstance();
return outboundDbConnection;
}
}
接口
public interface OutBoundDbConnection {
public Connection Dbconnection(String dbdrivers, String dbname);
public Connection Dbconnection();
public Connection Dbconnection1();
}
调用
InterfaceFactory interfaceFactory = new InterfaceFactory();
con = interfaceFactory.getOutboundDbConnection().Dbconnection();

热门栏目