新车上路,慎重上车。
登录文章链接:link
TypeService.java(接口) 有些功能本人也没写,你们可以试试,嘿嘿拓展下。
package service;
import bean.bean;
import bean.bookBean;
import bean.registerBean;
import bean.totalBookBean;
import java.util.List;
public interface TypeService {
//增加
public Boolean addBean(registerBean y);
//查询
public Boolean selects(bean y);
//删除
public void delete(bean y);
//修改
public void update(bean y);
//查询书名
public Boolean selectBook(bookBean y);
//显示全部书籍
public List<totalBookBean> display(totalBookBean y);
}
TypeServiceImp.java
package service.imp;
import bean.bean;
import bean.registerBean;
import bean.bookBean;
import bean.totalBookBean;
import dao.TypeDao;
import dao.imp.TypeDaoImp;
import service.TypeService;
import java.util.List;
//类只能被继承extend
public class TypeServiceImp implements TypeService {
TypeDao td = new TypeDaoImp();
//增加
@Override
public Boolean addBean(registerBean y) {
boolean repeat = td.addBean(y);
td.totalClose();
return repeat;
}
@Override
public void update(bean y) {
}
@Override
public void delete(bean y) {
}
@Override
public Boolean selects(bean y) {
boolean loginSelect = td.selects(y);
return loginSelect;
}
@Override
//查询书名
public Boolean selectBook(bookBean y)
{
boolean existence = td.selectBook(y);
return existence;
}
//显示全部书籍
public List<totalBookBean> display(totalBookBean y){
List<totalBookBean> tbb;
tbb = td.display(y);
td.totalClose();
return tbb;
}
}
dao层 (跟数据库交互)
TypeDao.java
package dao;
import bean.bean;
import bean.bookBean;
import bean.registerBean;
import bean.totalBookBean;
import java.util.List;
public interface Type