資源簡介
一個很基礎的Java實例,實現最基礎的增刪改查
代碼片段和文件信息
package?com.sqc.dao;
import?java.sql.Connection;
import?java.sql.PreparedStatement;
import?com.sqc.model.Client;
public?class?ClientDao?{
/**
?*?客戶信息增加
?*?@param?con
?*?@param?client
?*?@return
?*?@throws?Exception
?*/
public?int?add(Connection?con?Client?client)?throws?Exception{
//?TODO?Auto-generated?method?stub
String?sql?=?“insert?into?tb_client?values(?????)“;
??PreparedStatement?pstmt=con.prepareStatement(sql);
??pstmt.setString(1?client.getCid());
??pstmt.setString(2?client.getCname());
??pstmt.setString(3?client.getCsex());
??pstmt.setInt(4?client.getCage());
??pstmt.setString(5?client.getCtel());
??return?pstmt.executeUpdate();
}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-06-24?13:35??HotelManage\
?????文件?????????532??2018-06-29?20:04??HotelManage\.classpath
?????文件?????????387??2018-06-27?20:14??HotelManage\.project
?????目錄???????????0??2018-07-08?20:50??HotelManage\.settings\
?????文件?????????598??2018-06-27?20:14??HotelManage\.settings\org.eclipse.jdt.core.prefs
?????目錄???????????0??2018-07-08?20:50??HotelManage\bin\
?????目錄???????????0??2018-07-08?20:50??HotelManage\bin\com\
?????目錄???????????0??2018-07-08?20:50??HotelManage\bin\com\sqc\
?????目錄???????????0??2018-07-08?20:50??HotelManage\bin\com\sqc\dao\
?????文件????????1221??2018-06-29?20:04??HotelManage\bin\com\sqc\dao\ClientDao.class
?????文件????????2518??2018-06-30?14:34??HotelManage\bin\com\sqc\dao\ExRoomDao.class
?????文件????????1228??2018-07-05?17:48??HotelManage\bin\com\sqc\dao\OrderDao.class
?????文件????????1606??2018-07-05?17:30??HotelManage\bin\com\sqc\dao\RoomDao.class
?????文件????????2570??2018-06-29?20:04??HotelManage\bin\com\sqc\dao\StaffDao.class
?????文件????????1492??2018-06-29?20:04??HotelManage\bin\com\sqc\dao\UserDao.class
?????目錄???????????0??2018-07-08?20:50??HotelManage\bin\com\sqc\model\
?????文件????????1583??2018-07-04?21:30??HotelManage\bin\com\sqc\model\Client.class
?????文件????????2235??2018-06-30?14:32??HotelManage\bin\com\sqc\model\ExRoom.class
?????文件????????2632??2018-06-29?20:04??HotelManage\bin\com\sqc\model\Order.class
?????文件????????1514??2018-06-29?20:04??HotelManage\bin\com\sqc\model\Room.class
?????文件????????1812??2018-07-05?14:57??HotelManage\bin\com\sqc\model\Staff.class
?????文件?????????870??2018-07-05?15:37??HotelManage\bin\com\sqc\model\User.class
?????目錄???????????0??2018-07-08?20:50??HotelManage\bin\com\sqc\util\
?????文件????????1665??2018-06-29?20:04??HotelManage\bin\com\sqc\util\DbUtil.class
?????文件?????????669??2018-07-05?15:38??HotelManage\bin\com\sqc\util\StringUtil.class
?????目錄???????????0??2018-07-08?20:50??HotelManage\bin\com\sqc\view\
?????文件?????????739??2018-06-29?20:19??HotelManage\bin\com\sqc\view\CheckFra$1.class
?????文件?????????739??2018-06-29?20:19??HotelManage\bin\com\sqc\view\CheckFra$2.class
?????文件?????????707??2018-06-29?20:19??HotelManage\bin\com\sqc\view\CheckFra$3.class
?????文件????????8394??2018-06-29?20:19??HotelManage\bin\com\sqc\view\CheckFra.class
?????文件?????????759??2018-06-29?20:04??HotelManage\bin\com\sqc\view\ClientAddFra$1.class
............此處省略106個文件信息
評論
共有 條評論