導航:首頁 > 源碼編譯 > javaweb找源碼

javaweb找源碼

發布時間:2024-02-23 15:44:22

Ⅰ 求java web增刪改查 極簡源碼

//用戶新增
publicbooleanaddUser(Usersuser){
try{
conn=ConnDB.getConnection();
Stringsql="insertintotb_usersvalues(default,?,?,?,?,?,?)";
System.out.println(sql);
ps=conn.prepareStatement(sql);
ps.setInt(1,user.getDepID());
ps.setString(2,user.getUserName());
ps.setString(3,user.getUserPwd());
ps.setString(4,user.getUserCode());
ps.setString(5,user.getUserSex());
ps.setInt(6,user.getUserAge());
if(ps.executeUpdate()==1){
returntrue;
}
}catch(Exceptione){
e.printStackTrace();
}finally{//關閉當前頁打開的相關對象
ConnDB.close(conn,ps,null);
}
returnfalse;
}
//用戶刪除
publicbooleandelUser(intid){
try{
conn=ConnDB.getConnection();
Stringsql="deletefromtb_userswhereid=?";
System.out.println(sql);
ps=conn.prepareStatement(sql);
ps.setInt(1,id);
if(ps.executeUpdate()==1){
returntrue;
}
}catch(Exceptione){
e.printStackTrace();
}finally{//關閉當前頁打開的相關對象
ConnDB.close(conn,ps,null);
}
returnfalse;
}
//用戶編輯
publicbooleanupdateUser(Usersuser){
try{
conn=ConnDB.getConnection();
Stringsql="updatetb_userssetdepID=?,userName=?,userPwd=?,userCode=?,userSex=?,userAge=?whereid=?";
System.out.println(user.getDepID()+user.getUserName()+user.getUserPwd()+user.getUserCode()+user.getUserSex()+user.getUserAge()+user.getId());
ps=conn.prepareStatement(sql);
ps.setInt(1,user.getDepID());
ps.setString(2,user.getUserName());
ps.setString(3,user.getUserPwd());
ps.setString(4,user.getUserCode());
ps.setString(5,user.getUserSex());
ps.setInt(6,user.getUserAge());
ps.setInt(7,user.getId());
if(ps.executeUpdate()==1){
returntrue;
}
}catch(Exceptione){
e.printStackTrace();
}finally{//關閉當前頁打開的相關對象
ConnDB.close(conn,ps,null);
}
returnfalse;
}
//根據id查詢用戶
publicUsersfindAllUserById(intid){
Usersu=null;
DepDaodepd=null;
try{
conn=ConnDB.getConnection();
Stringsql="select*fromtb_userswhereid=?";
System.out.println(sql);
ps=conn.prepareStatement(sql);
ps.setInt(1,id);
rs=ps.executeQuery();
if(rs.next()){
depd=newDepDao();
Departmentdep=depd.findAllDepById(rs.getInt("depID"));
System.out.println(dep.getDepName());
u=newUsers();
u.setId(rs.getInt("id"));
u.setDepID(rs.getInt("depID"));
u.setUserName(rs.getString("userName"));
u.setUserPwd(rs.getString("userPwd"));
u.setUserCode(rs.getString("userCode"));
u.setUserSex(rs.getString("userSex"));
u.setUserAge(rs.getInt("userAge"));
u.setDep(dep);
}

}catch(Exceptione){
e.printStackTrace();
}finally{//關閉當前頁打開的相關對象
ConnDB.close(conn,ps,rs);
}
returnu;
}

這是我在層寫的代碼,都調用了ConnDB這個類,這個類完成了驅動的注冊,及連接資料庫的功能,代碼如下:

packagecom.asjy.util;

importjava.sql.Connection;
importjava.sql.DriverManager;
importjava.sql.PreparedStatement;
importjava.sql.ResultSet;
importjava.sql.SQLException;
importjava.sql.Statement;

publicclassConnDB{
privatestaticStringurl="jdbc:mysql://localhost:3306/news";
privatestaticStringuser="root";
privatestaticStringpass="root";

//1.載入驅動
static{
try{
Class.forName("com.mysql.jdbc.Driver");
}catch(ClassNotFoundExceptione){
System.out.println("驅動載入失敗");
}
}


//2.建立資料庫連接對象
()throwsException{
returnDriverManager.getConnection(url,user,pass);
}

//3.關閉資料庫
publicstaticvoidclose(Connectionconn,Statementps,ResultSetrs){
try{
if(rs!=null){
rs.close();
rs=null;
}
if(ps!=null){
ps.close();
ps=null;
}
if(conn!=null){
conn.close();
conn=null;
}
}catch(SQLExceptione){
e.printStackTrace();
}
}
}

Ⅱ 哪裡有JAVA開發板,軟體開發平台,Web開發平台或快速開發平台的源碼,包括工作流源碼,還有JAVA OA源碼

公司OA業務擴展需要,需要有相應的開發平台和OA系統支撐,希望符合一下條件:JAVA、J2EE,JAVA快速開發平台源碼,JAVA軟體開發平台源碼,或者JAVA開發板源碼,包括JAVA工作流源碼,最好是JBPM的,另外就是有相應的系統源碼,如JAVA OA系統源碼。

首先您需要一個帶由標准OA 的開發平台,平台的語言是JAVA,J2EE,那麼很好,我這邊推薦下天翎的地代碼開發平台,本身是java語言,自帶宏語言,就是J2ee,所以,在這個維度是吻合,另外現在如果他們周年慶合作,會有一個優惠,贈送知識文檔管理系統和OA 系統。基本上該有的公文處理,待辦事情等都具備。

看是否這樣的回復是吻合貴司需求的?

存在即合理

Ⅲ 在哪裡能下載到javaweb項目的源代碼

非常多啊, 你說的虛擬社區本質上就是bbs的那些源碼
直接springboot寫或者springmvc+mybatis寫也行

Ⅳ 在哪能下載javaweb項目模板

  1. 可以在開源中國網站上面下載源碼

  2. GitHub上面上面下載,搜索框中輸入自己想找的模板名稱

  3. CSDN社區上面可以下載項目模板

這是我常常下載的三個地方,希望能幫到你。

Ⅳ 什麼是java源代碼 怎麼查看

不知道你說的是瀏覽器的還是什麼的,
如果是瀏覽器的那麼簡單找到工具-查看源代碼,你就能看見代碼了,
還有一個就是被編譯成class文件的java用反編譯工具可以看到源代碼,
如果以上都不是你想要的答案,那麼你所說的代碼就是程序員寫好的代碼文件

閱讀全文

與javaweb找源碼相關的資料

熱點內容
簽字版pdf 瀏覽:308
主角姓庄穿越到香港當探長 瀏覽:271
百度網盤視頻是雙語的怎麼改為單語的 瀏覽:334
伺服器關閉玩家充的錢怎麼辦 瀏覽:251
日本男男影片 瀏覽:860
matlab實用教程pdf 瀏覽:769
伺服器加密方式哪種好 瀏覽:121
顯示加密服務超時 瀏覽:611
日語口譯pdf 瀏覽:433
外人如何評價身邊的程序員 瀏覽:105
霍夫曼編碼壓縮演算法 瀏覽:122
我想學習單片機 瀏覽:644
陳寶蓮拍過 瀏覽:336
遙調命令的設定命令實現過程 瀏覽:76
演算法中最壞情況都為多少 瀏覽:995
排序演算法圖形化展示 瀏覽:782
看電影免費網站入口 瀏覽:447
加密U盤啟動區和交換區格式化 瀏覽:247
求不需要下載播放器就能看的網站 瀏覽:828
日本重生電影在線 瀏覽:623