连接数据池

80酷酷网    80kuku.com

  数据类中

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();



分享到
  • 微信分享
  • 新浪微博
  • QQ好友
  • QQ空间
点击: