interface IDAL{
public void Insert();
public void Delete();
}
class SQLHelper implements IDAL{
}
怎样实现兼容性:
实现接口对象
把不同的数据库连接对象分别赋给实现的接口对象
DAL dal = new DAL();
dal = new MySQLHelper();
dal.Insert(pm);
public void Insert();
public void Delete();
}
class SQLHelper implements IDAL{
}
怎样实现兼容性:
实现接口对象
把不同的数据库连接对象分别赋给实现的接口对象
DAL dal = new DAL();
dal = new MySQLHelper();
dal.Insert(pm);

本文深入探讨了如何通过实现接口对象来实现在不同数据库间的兼容性,具体介绍了如何将MySQLHelper对象赋给DAL接口,并调用其特定方法进行数据库操作。
1205

被折叠的 条评论
为什么被折叠?



