连接数据池

类别:Java 点击:0 评论:0 推荐:

类中

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

本文地址:http://com.8s8s.com/it/it15680.htm