数据库

解决方案 »

  1.   

    try {
    if(ICartActionDao.selectGood(isbn)==null){
    ICartActionDao.addGood(isbn, username, price, imagesFile, shu, title);
    }
    else 
    {
    ICartActionDao.UpdateGood(isbn,shu);
    }
    这样,没报错,但数据库没添加上数据
      

  2.   

    try {
    if(ICartActionDao.selectGood(isbn)==null){
    ICartActionDao.addGood(isbn, username, price, imagesFile, shu, title);
    }
    else 
    {
    ICartActionDao.UpdateGood(isbn,shu);
    }
    这样,没报错,但数据库没添加上数据
    只添加不判断,就没事,是不是查询出错了???
      

  3.   

    不管有没有先delete,在insert,如果update的话,是不是效率有点低啊。