資源簡介
使用java jsp SQL 編寫的【商務會員管理系統】 不是太完美 但是也能修改會員密碼 查詢會員(可以以姓查詢) 數據庫自己寫吧

代碼片段和文件信息
package?cn.hlc.Dao;
import?java.sql.Connection;
import?java.sql.DriverManager;
import?java.sql.PreparedStatement;
import?java.sql.ResultSet;
import?java.sql.SQLException;
public?class?baseDao?{
???private?PreparedStatement?pstmt;
???private?Connection?coon;
???private?ResultSet?rs;
//獲得鏈接
???public?void?getConnection(){
????try?{
Class.forName(“com.mysql.jdbc.Driver“);
coon=DriverManager.getConnection(“jdbc:mysql://127.0.0.1:3306/shop““root““521406“);
}?catch?(ClassNotFoundException?e)?{
e.printStackTrace();
}?catch?(SQLException?e)?{
e.printStackTrace();
}
???}
???//關閉所有對象
???public?void?closeAll(){
try?{
if(pstmt!=null)
pstmt.close();
if(rs!=null)
???? rs.close();
????if(coon!=null)
???? coon.close();
}?catch?(SQLException?e)?{
e.printStackTrace();
}
???}
???//增刪改
???public?int?executeSQL(String?sqlobject...objects){
???this.getConnection();
???int?count=-1;
???try?{
pstmt=coon.prepareStatement(sql);
?for(int?i=0;ijects.length;i++){
?pstmt.setobject(i+1?objects[i]);
?}
?count=pstmt.executeUpdate();
}?catch?(SQLException?e)?{
e.printStackTrace();
}finally{
this.closeAll();
}
???return?count;
???}
???//查詢
???
???public?ResultSet?executeSql(String?sqlobject...objects){
???this.getConnection();
???try?{
pstmt=coon.prepareStatement(sql);
for(int?i=0;ijects.length;i++){
pstmt.setobject(i+1?objects[i]);
}
rs=pstmt.executeQuery();
}?catch?(SQLException?e)?{
e.printStackTrace();
}
???return?rs;
???}
???
???
???
???
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????730??2018-10-22?15:30??Shop\.classpath
?????文件???????1253??2018-10-22?09:42??Shop\.project
?????文件????????503??2018-10-22?08:58??Shop\.settings\.jsdtscope
?????文件????????364??2018-10-22?15:30??Shop\.settings\org.eclipse.jdt.core.prefs
?????文件????????464??2018-10-22?08:58??Shop\.settings\org.eclipse.wst.common.component
?????文件????????345??2018-10-22?08:58??Shop\.settings\org.eclipse.wst.common.project.facet.core.xm
?????文件?????????49??2018-10-22?08:58??Shop\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件??????????6??2018-10-22?08:58??Shop\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????文件???????2239??2018-10-22?15:30??Shop\build\classes\cn\hlc\Dao\ba
?????文件???????2487??2018-10-22?15:30??Shop\build\classes\cn\hlc\Dao\UsersDao.class
?????文件????????283??2018-10-22?15:30??Shop\build\classes\cn\hlc\Dao\User_typeDao.class
?????文件???????1555??2018-10-22?15:30??Shop\build\classes\cn\hlc\Entity\Users.class
?????文件????????723??2018-10-22?15:30??Shop\build\classes\cn\hlc\Entity\User_type.class
?????文件???????1270??2018-10-22?15:30??Shop\build\classes\cn\hlc\services\UsersDaoService.class
?????文件????????575??2018-10-22?13:56??Shop\content.jsp
?????文件???????1152??2018-10-22?10:39??Shop\domodiPwd.jsp
?????文件????????555??2018-10-22?09:42??Shop\doquery.jsp
?????文件????????437??2018-10-22?09:42??Shop\exitdo.jsp
?????文件?????304438??2018-10-22?09:42??Shop\jquery-1.12.4.js
?????文件????????705??2018-10-22?13:47??Shop\left.jsp
?????文件???????1593??2018-10-22?14:01??Shop\login.jsp
?????文件???????1227??2018-10-22?09:42??Shop\logindo.jsp
?????文件???????1378??2018-10-22?13:56??Shop\main.jsp
?????文件?????????39??2018-10-22?09:42??Shop\me
?????文件???????1698??2018-10-22?14:09??Shop\modiPwd.jsp
?????文件???????1601??2018-10-22?09:42??Shop\query.jsp
?????文件???????2391??2018-10-22?09:00??Shop\shop.sql
?????文件???????1651??2018-10-22?09:44??Shop\src\cn\hlc\Dao\ba
?????文件???????3233??2018-10-22?08:58??Shop\src\cn\hlc\Dao\UsersDao.java
?????文件?????????61??2018-10-22?08:58??Shop\src\cn\hlc\Dao\User_typeDao.java
............此處省略58個文件信息
評論
共有 條評論