• 大小: 7.89MB
    文件类型: .zip
    金币: 2
    下载: 1 次
    发布日期: 2023-08-26
  • 语言: 其他
  • 标签: java  旅游  

资源简介

仿携程APP界面,有游客和管理员两个角色,游客登录可以实现酒店、机票等查询功能;管理员登录可以实现录入酒店、游客信息等功能

资源截图

代码片段和文件信息

package dao;

import java.sql.SQLException;
import java.util.ArrayList;

import util.DaoSupport;
import vo.Food;

public class FoodDao extends DaoSupport{
public int insertFoodio(Food f) throws SQLException{
int i=0;
this.openConnection();
String sql=“insert into t_food values (??????)“;
pstmt=conn.prepareStatement(sql);
pstmt.setString(1 f.getFoodID());
pstmt.setString(2 f.getFoodname());
pstmt.setString(3 f.getFoodaddress());
pstmt.setFloat(4 f.getFoodscore());
pstmt.setInt(5 f.getAvprice());
pstmt.setString(6 f.getFoodinfo());
i=pstmt.executeUpdate();
this.closeConnection();
return i;
}

public int deleteFoodioByname(String foodname) throws SQLException{
int i=0;
this.openConnection();
String sql=“delete from t_food where foodname=?“;
pstmt=conn.prepareStatement(sql);
pstmt.setString(1 foodname);
i=pstmt.executeUpdate();
this.closeConnection();
return i;
}

public int updateFoodio(Food f) throws SQLException{
int i=0;
this.openConnection();//建立连接
String sql=“update t_food set foodaddress=?foodscore=?avprice=?foodinfo=? where foodname=?“;
pstmt=conn.prepareStatement(sql);//设置第一个问号,字符类型
pstmt.setString(1 f.getFoodaddress());//字符类型
pstmt.setFloat(2 f.getFoodscore());
pstmt.setInt(3 f.getAvprice());//
pstmt.setString(4 f.getFoodinfo());
pstmt.setString(5 f.getFoodname());
i=pstmt.executeUpdate();
this.closeConnection();
return i;
}
//查询操作
public ArrayList queryAllFoodsByNameStr(String nameStr) throws SQLException{
ArrayList al=new ArrayList();
String sql=“select * from t_food where foodaddress like ?“;//
this.openConnection();//建立连接
pstmt=conn.prepareStatement(sql);
pstmt.setString(1 “%“+nameStr+“%“);
rs=pstmt.executeQuery();
while(rs.next()){
Food f=new Food();
f.setFoodname(rs.getString(“foodname“));
f.setFoodaddress(rs.getString(“foodaddress“));
f.setFoodscore(rs.getFloat(“foodscore“));
f.setAvprice(rs.getInt(“avprice“));
f.setFoodinfo(rs.getString(“foodinfo“));
al.add(f);
}
this.closeConnection();
return al;
}
public ArrayList queryAllFoods() throws SQLException{
ArrayList al=new ArrayList();
String sql=“select * from t_food “;//
this.openConnection();//建立连接
pstmt=conn.prepareStatement(sql);
rs=pstmt.executeQuery();
while(rs.next()){
Food f=new Food();
f.setFoodname(rs.getString(“foodname“));
f.setFoodaddress(rs.getString(“foodaddress“));
f.setFoodscore(rs.getFloat(“foodscore“));
f.setAvprice(rs.getInt(“avprice“));
f.setFoodinfo(rs.getString(“foodinfo“));
al.add(f);
}
this.closeConnection();
return al;
}
}


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-01-13 22:48  Text\
     文件         392  2018-01-07 09:56  Text\.classpath
     文件         380  2018-01-07 09:58  Text\.project
     目录           0  2018-01-13 22:48  Text\.settings\
     文件         598  2018-01-07 09:56  Text\.settings\org.eclipse.jdt.core.prefs
     目录           0  2018-01-13 22:48  Text\bin\
     目录           0  2018-01-13 22:48  Text\bin\dao\
     文件        3934  2018-01-13 21:50  Text\bin\dao\FoodDao.class
     文件        4735  2018-01-13 21:50  Text\bin\dao\HotelDao.class
     文件        4667  2018-01-13 21:50  Text\bin\dao\InnDao.class
     文件        4800  2018-01-13 21:50  Text\bin\dao\PlaneDao.class
     文件        3598  2018-01-13 21:50  Text\bin\dao\RouteDao.class
     文件        4242  2018-01-13 21:51  Text\bin\dao\SightDao.class
     文件        4700  2018-01-07 09:58  Text\bin\dao\TrainDao.class
     文件        3144  2018-01-07 09:58  Text\bin\dao\UserDao.class
     目录           0  2018-01-13 22:48  Text\bin\images\
     文件       72871  2017-12-13 23:04  Text\bin\images\03de06cc9c68d3ef5720e039da60bcf7.jpg
     文件       36395  2017-12-13 23:04  Text\bin\images\0530a19c1d577f40eae9fe4e7e5a78f1.jpg
     文件       59399  2018-01-03 19:41  Text\bin\images\1f76e7c6f16b05faa5a0da11f5cd3121_b8e3f089jw1eornngwe9kj20or0i10uc_副本.jpg
     文件       64843  2018-01-03 18:49  Text\bin\images\2284815060731dbc12b1edafa93c233c_100602093105cd81c5baf0f551_副本.jpg
     文件      109436  2017-12-13 23:04  Text\bin\images\240379-14051PH02466.jpg
     文件        4524  2017-12-24 22:43  Text\bin\images\2e70ff5d2d5b761c28e8f4335be2c20f_19369522_133848662000_2_副本_副本.png
     文件      116422  2018-01-03 18:49  Text\bin\images\45ef0c97745f3919b6c888855b18d89a_12507089_104623150127_2_副本.jpg
     文件       68487  2018-01-03 18:49  Text\bin\images\498c91fa350a09eae05315583ad1cd38_t01a1e295d105688d90_副本.jpg
     文件       25360  2018-01-03 13:07  Text\bin\images\4ce5c2247b7d428f6cd6d7a5e93cef50_t017b1a9862595e80a4_副本.jpg
     文件       52730  2018-01-03 19:38  Text\bin\images\607fac0c13c3c79fd15000f3f2b24d23_t012ebb1a981fe9d037_副本.jpg
     文件        2792  2017-12-26 16:03  Text\bin\images\62e9dc5ef0998c157af3946a8e23d2ef_201641685746451_副本.png
     文件       20194  2017-12-24 19:05  Text\bin\images\65c70e6b00d1f74b27ed3627e2856983_20130516215833_wCAMc_副本.jpg
     文件       60016  2017-12-20 00:26  Text\bin\images\6bec5354d717659bcff64497831d0c38_mh1513174113036_副本_副本.jpg
     文件      510800  2017-12-30 19:18  Text\bin\images\6bec5354d717659bcff64497831d0c38_mh1513174113036_副本_副本_副本.png
     文件       63157  2017-12-25 14:05  Text\bin\images\833ecbcaf3ab02afe76465d4eba72220_3f9f9364535b401681728edb1e27bc07_副本.jpg
............此处省略364个文件信息

评论

共有 条评论