资源简介
基于JSP开发的一个出租车管理系统,包括对司机信息的增删改查,车辆信息的增删改查,还集成的百度地图的API,可以实现手动定位。

代码片段和文件信息
package biz;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import entity.Car;
public class CarBiz {
private Connection connection =null;
private Statement statement =null;
public CarBiz() {
}
public CarBiz(Connection connection){
this.connection = connection;
}
public int insert(Car car){
PreparedStatement pstm = null;
int affect = 0;//0表示正常状态,-1表示失败,1表示成功
String sql = “Insert into car( “ +
“carnumbercartypecarcompanycarpurchasecarusetime“+
“ ) values ( “+
“? ? ? ??)“;
try {
pstm = connection.prepareStatement(sql);
pstm.setString(1 car.getCarNumber());
pstm.setString(2 car.getCarType());
pstm.setString(3 car.getCarCompany());
pstm.setString(4 car.getCarPurchase());
pstm.setInt(5 car.getCarUsetime());
affect = pstm.executeUpdate();
} catch (Exception e) {
affect = -1;
e.printStackTrace();
}finally{
try {
if (pstm != null) {
pstm.close();
}
} catch (SQLException e) {
e.printStackTrace();
}
}
return affect;
}
public int countWhere(String carnumber){
ResultSet rs = null;
int count = 0;
String sql = “SELECT COUNT(1) CT FROM car WHERE carnumber =‘“+carnumber+“‘“;
try {
statement = (Statement) connection.createStatement();
rs = statement.executeQuery(sql);
if (rs.next()) {
count = rs.getInt(“CT“);
}
} catch (SQLException e) {
e.printStackTrace();
}finally{
try {
if (rs != null) {
rs.close();
}
if (statement != null) {
statement.close();
}
} catch (SQLException e) {
e.printStackTrace();
}
}
return count;
}
public Car selectCar(String carnumber){
ResultSet rs = null;
Car car = null;
String sql = “SELECT * FROM car WHERE carnumber =‘“+carnumber+“‘“;
try {
statement = connection.createStatement();
rs = statement.executeQuery(sql);
car = new Car();
if (rs.next()) {
car.setCarNumber(rs.getString(“carnumber“));
car.setCarType(rs.getString(“cartype“));
car.setCarCompany(rs.getString(“carcompany“));;
car.setCarPurchase(rs.getString(“carpurchase“));;
car.setCarUsetime(rs.getInt(“carusetime“));
}
} catch (SQLException e) {
e.printStackTrace();
}finally{
try {
if (rs != null) {
rs.close();
}
if (statement != null) {
statement.close();
}
} catch (SQLException e) {
e.printStackTrace();
}
}
return car;
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-03-11 11:14 Didi\
文件 1186 2016-11-23 16:40 Didi\.classpath
目录 0 2017-03-11 11:17 Didi\.git\
文件 13 2017-03-11 11:16 Didi\.git\COMMIT_EDITMSG
文件 23 2017-03-11 11:14 Didi\.git\HEAD
文件 298 2017-03-11 11:17 Didi\.git\config
文件 73 2017-03-11 11:14 Didi\.git\desc
目录 0 2017-03-11 11:14 Didi\.git\hooks\
文件 478 2017-03-11 11:14 Didi\.git\hooks\applypatch-msg.sample
文件 896 2017-03-11 11:14 Didi\.git\hooks\commit-msg.sample
文件 189 2017-03-11 11:14 Didi\.git\hooks\post-update.sample
文件 424 2017-03-11 11:14 Didi\.git\hooks\pre-applypatch.sample
文件 1642 2017-03-11 11:14 Didi\.git\hooks\pre-commit.sample
文件 1348 2017-03-11 11:14 Didi\.git\hooks\pre-push.sample
文件 4951 2017-03-11 11:14 Didi\.git\hooks\pre-reba
文件 544 2017-03-11 11:14 Didi\.git\hooks\pre-receive.sample
文件 1239 2017-03-11 11:14 Didi\.git\hooks\prepare-commit-msg.sample
文件 3610 2017-03-11 11:14 Didi\.git\hooks\update.sample
文件 7615 2017-03-11 11:16 Didi\.git\index
目录 0 2017-03-11 11:14 Didi\.git\info\
文件 240 2017-03-11 11:14 Didi\.git\info\exclude
目录 0 2017-03-11 11:16 Didi\.git\logs\
文件 159 2017-03-11 11:16 Didi\.git\logs\HEAD
目录 0 2017-03-11 11:17 Didi\.git\logs\refs\
目录 0 2017-03-11 11:16 Didi\.git\logs\refs\heads\
文件 159 2017-03-11 11:16 Didi\.git\logs\refs\heads\master
目录 0 2017-03-11 11:17 Didi\.git\logs\refs\remotes\
目录 0 2017-03-11 11:17 Didi\.git\logs\refs\remotes\origin\
文件 143 2017-03-11 11:17 Didi\.git\logs\refs\remotes\origin\master
目录 0 2017-03-11 11:16 Didi\.git\ob
目录 0 2017-03-11 11:14 Didi\.git\ob
............此处省略261个文件信息
相关资源
- 微博系统(Java源码,servlet+jsp),适
- JSP企业人事管理系统设计(源代码+论
- 实现一个图书管理系统
- JAVA JSP公司财务管理系统 源代码 论文
- JSP+MYSQL旅行社管理信息系统
- JSP,SQL,MVC的选课系统
- 基于JSP的学生宿舍管理系统(源码 数
- JSP选课管理系统
- mysql jsp网站源码下载
- JSP做的化妆品商城
- Jsp购物车实例
- 基于JSP的校友信息管理系统(添加数
- 基于jsp的bbs论坛 非常详细
- jsp oracle通讯录
- JSP学生信息管理系统 Mysql数据库
- 使用jsp servlet做的投票系统
- JSP登陆验证 实现JSP用户名 密码 验
- jsp基于servlet 图书馆管理系统
- jsp学生成绩管理系统.rar
- 在线考试系统源代码(jsp)
- 超级好的纯jsp写的聊天室
- JSP 网上购物网页项目
- JSP+mysql新闻发布系统.rar
- jsp 学生信息管理系统设计与实现
- jsp与SQL Server数据库实现的客户注册登
- 简易教学管理系统(jsp spring struts h
- 学生信息管理系统 JSP MySQL
- jsp ajax 三级联动菜单
- jsp新闻公告与最新消息系统(具备添
- JSP课程设计-留言本 jsp mysql tomcat实现
评论
共有 条评论