连接数据池
发表于:2007-07-04来源:作者:点击数:
标签:
类中 public class InterfaceFactory { OutBoundDbConnection outboundDbConnection = null; public OutBoundDbConnection getOutboundDbConnection() throws Inst ant iationException, IllegalAccessException, ClassNotFoundException { outboundDbConnect
类中
public class InterfaceFactory {
OutBoundDbConnection outboundDbConnection = null;
public OutBoundDbConnection getOutboundDbConnection()
throws
Inst
antiationException,
IllegalA
clearcase/" target="_blank" >ccessException,
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();
原文转自:http://www.ltesting.net