當前位置:首頁 » 操作系統 » ssh實例源碼

ssh實例源碼

發布時間: 2022-09-03 13:55:23

Ⅰ 求一個完整基於SSH2框架,且已實現基本的增刪改查項目源代碼 (純學習)

http://hi..com/wzqiajng/item/d89a0b9b22c767d11b49df16
這個是SSH2框架整合(Struts2.1.6+hibernate3.3.2+spring2.5.6)的一個簡單教程 裡面有
增刪改查的基本功能的

Ⅱ 求一份ssh2寫的科研項目管理系統的源代碼

可、以、說、說、具、體、的、要、求、么?

Ⅲ ssh框架代碼

java ssh怎樣學習!

您好:
感謝你對EasyJF的關注以及對國內開源的支持,國內環境普遍浮躁,因為有太多像春迷這樣的人存在,搞得大家都不敢表達自己的思想了,因此還希望以後能繼續多對國內開源人給予支持。

關於您來信中說到的問題,我覺得可能是你對java的基礎的掌握還不夠的原因,簡單來說就是內力不夠。好比中國傳統武俠小說中練武人的內力問題,降龍十八掌這樣的絕世掌法,要是沒有一定的內力作基礎的話,就只能是降蛇十八掌,甚至蛇都降不了。虛竹小和尚的武功也是因為有了高深的內力,才能變得那麼牛的。 而修練J2EE武學的內力,我認為大致分為三層,初級層次是JAVA基礎,第二層次是OO思想及模式,第三層次是特定領域(如Web開發相關技術規范、Servlet規范、JPA規范、EJB3規范等)、專業知識的學習。有了這些內力,不管他是SSH還是EasyJF,使用起來都會非常容易的。

SSH屬於框架,屬於工具,也是中間件。他們是用來提高我們的開發效率,提高我們軟體產品的可維護性、可擴展性乃至敏捷性的。

他們裡面有很我優秀的設計理念及模式應用。比如, struts屬於MVC框架,關鍵是要了解MVC的概念及大致原理,掌握就很容易了;而hibernate屬於orm系統,屬於持久層的解決方案,同樣需要對ORM的概念及原理有一個總體的了解,必要時可以去查查EJB1及EJB2裡面用於持久層的Entity Bean的使用。而spring屬於應用程序框架,其核心是IOC容器以及AOP,把這兩個核心概念(也可稱為大模式)了解以後,再加上一定的內力修為,其它就都不難了。Spring中還集成了很多適用東西(不過這些東西80%的在某一個項目中可能一直用不上),比如對JDBC的封裝、自己的MVC、對動態語言的簡潔訪問等,這些你根據自己的項目情況來選擇學習,用到的時候再看看他的文檔,一個項目下來應該就能把握。

說了那麼多,我累了,你一定也有點暈了,下面結合你的情況,簡單發表一點我的建議:
1、用一年的時間慢慢提升自己的內力,然後這期間可以通過下面的方法同步學習使用ssh。
2、看一些國內作者原創的書籍,並運行相關代碼,比如孫衛琴的Struts及Hibernate等入門教程,羅時飛的Spring教程。他們的書都通谷易懂,很多屬於他們在學習過程中的點滴記錄,因此一定非常好懂。不要一下子就去讀Rod的《J2EE Without EJB》,或者是Spring開發團隊編寫的《Spring框架高級編程》,甚至《Spring in action》!由於很多緣故,這些書看了你一定會更暈。
3、下載一些國內原創的SSH應用源碼示例。國外有很多這樣的,也可以多看看。
4、運行這些框架所附帶Example示例,並了解其設計原理,並能簡單修改。
5、運行並多看這些框架的測試代碼。要像買彩民分析采票走勢圖那樣慢慢琢磨分析。
6、在自己的項目中多動用,熟練使用一個開發工具,如Eclipse,並能掌握程序調試技巧。

Ⅳ 求ssh2人事管理系統源碼

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

Ⅵ 跪求一個SSH框架完整項目源碼(比較成熟一點的)

這個是一個寵物養成系統SSH框架整合做的。希望對你有幫助 !

Ⅶ 求 java web開發 ssh2整合(struts2 hibernate3 spring2.5)項目源碼

資料庫是mysql的,一個簡單清晰的小項目。用戶的增、刪、改、查,請查收!

Ⅷ 求一個SSH2登錄的源碼 oracle資料庫的 越詳細越好 本人新手!謝謝

我給你我原來寫過的吧。很久以前的了。只給你連接資料庫這些,其他的你自己看著寫吧。
下面是我當初寫的其中一個類,有注釋。你看看,模仿著寫吧,肯定能寫出來。.
package com.;

import java.sql.Connection;
import java.sql.Date;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.List;

import javax.servlet.jsp.jstl.sql.Result;
import javax.servlet.jsp.jstl.sql.ResultSupport;

import com.tool.BaseTool;

public class BillDAO {
// 資料庫連接
private Connection con;
// 資料庫SQL語句執行者對象
private Statement stmt;
// 資料庫SQL語句執行者對象
private PreparedStatement pstmt;
// 資料庫SQL查詢結果集
private ResultSet rs;

// 打開資料庫連接
private void openConnection() {

try {
// 載入資料庫驅動
Class.forName("oracle.jdbc.driver.OracleDriver");
// 獲得資料庫連接
con = DriverManager.getConnection(
"jdbc:oracle:thin:@localhost:1521:orcllib", "zxl", "zxl");
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
}

}

// 關閉資料庫連接及資源
private void closeConnection() {
if (rs != null) {
try {
rs.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
if (stmt != null) {
try {
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
if (pstmt != null) {
try {
pstmt.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
if (con != null) {
try {
con.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}

//檢查賬單編號是否存在的方法
@SuppressWarnings("finally")
public boolean checkBillNumber(long bill_number) {
boolean result = false;
openConnection();
// 編寫SQL語句
String sql = "select b.bill_number from bill b";
try {
// 實例化執行SQL語句的對象preparedstatement
stmt = con.createStatement();
// 執行查詢語句並返回結果集
rs = stmt.executeQuery(sql);
while (rs.next()) {
if (bill_number == rs.getLong("bill_number")) {
return result;
}
}
result = true;
} catch (SQLException e) {
e.printStackTrace();
} finally {
// 關閉資料庫連接及資源
closeConnection();
return result;
}
}

//分頁顯示賬單列表的方法
@SuppressWarnings("finally")
public Result getPagingBill(int page_number, int page_data_number) {
Result result = null;
// 打開資料庫連接
openConnection();
// 編寫SQL語句
String sql = "select r.bill_number,r.goods_name,r.goods_number,r.transaction_amount," +
"r.value_name,r.supplier_name,r.goods_description,r.bill_date from " +
"(select rownum as rn,b.* from bill_list_view b) r where r.rn between "+
BaseTool.getPagingString(page_number, page_data_number);
try {
// 實例化執行SQL語句的對象preparedstatement
stmt = con.createStatement();
// 執行查詢語句並返回結果集
rs = stmt.executeQuery(sql);
// 將結果集儲存在Result對象當中
result = ResultSupport.toResult(rs);
} catch (SQLException e) {
e.printStackTrace();
} finally {
// 關閉資料庫連接及資源
closeConnection();
return result;
}
}

//獲得賬單總數的方法
@SuppressWarnings("finally")
public int getBillCount() {
int result = 0;
// 打開資料庫連接
openConnection();
// 編寫SQL語句
String sql = "select count(b.bill_number) from bill_list_view b ";
try {
// 實例化執行SQL語句的對象preparedstatement
stmt = con.createStatement();
// 執行查詢語句並返回結果集
rs = stmt.executeQuery(sql);
// 取得賬單總數
while (rs.next()) {
result = rs.getInt(1);
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
// 關閉資料庫連接及資源
closeConnection();
return result;
}
}

//將用戶組合查詢的賬單列表分頁
@SuppressWarnings("finally")
public Result getFilterPagingBill(String goods_name, int pay_status ,
int page_number , int page_data_number){
Result result = null;
// 打開資料庫連接
openConnection();
// 編寫SQL語句
String sql = "select r.bill_number,r.goods_name,r.goods_number,r.transaction_amount," +
"r.value_name,r.supplier_name,r.goods_description,r.bill_date " +
" from (select rownum as rn,b.* from bill_list_view b where ";
String sql_last = ") r where r.rn between " + BaseTool.getPagingString(page_number, page_data_number);
// 將參數初始化
String value_name = "";
if (pay_status == 3)
value_name = "已付款";
else if (pay_status == 4)
value_name = "未付款";
else
value_name = null;
if ("".equals(goods_name.trim()))
goods_name = null;
// 按照用戶查詢的條件處理
try {
if (value_name != null && goods_name == null) {
sql = sql + "b.value_name=?" + sql_last;
pstmt = con.prepareStatement(sql);
pstmt.setString(1, value_name);
} else if (value_name == null && goods_name != null) {
goods_name = "%"+goods_name+"%";
sql = sql + "b.goods_name like ?" + sql_last;
pstmt = con.prepareStatement(sql);
pstmt.setString(1, goods_name);
} else {
goods_name = "%"+goods_name+"%";
sql = sql + "b.value_name=? and b.goods_name like ?" + sql_last;
pstmt = con.prepareStatement(sql);
pstmt.setString(1, value_name);
pstmt.setString(2, goods_name);
}
rs = pstmt.executeQuery();
result = ResultSupport.toResult(rs);
} catch (SQLException e) {
e.printStackTrace();
} finally {
closeConnection();
return result;
}
}

//獲得用戶組合查詢的賬單總數
@SuppressWarnings("finally")
public int getFilterBillCount(String goods_name, int pay_status) {
int result = 0;
// 打開資料庫連接
openConnection();
// 編寫SQL語句
String sql = "select count(b.bill_number) from bill_list_view b where ";
// 將參數初始化
String value_name = "";
if (pay_status == 3)
value_name = "已付款";
else if (pay_status == 4)
value_name = "未付款";
else
value_name = null;
if ("".equals(goods_name.trim()))
goods_name = null;
// 按照用戶查詢的條件處理
try {
if (value_name != null && goods_name == null) {
sql = sql + "b.value_name=? ";
pstmt = con.prepareStatement(sql);
pstmt.setString(1, value_name);
} else if (value_name == null && goods_name != null) {
goods_name="%"+goods_name+"%";
sql = sql + "b.goods_name like ? ";
pstmt = con.prepareStatement(sql);
pstmt.setString(1, goods_name);
} else {
goods_name="%"+goods_name+"%";
sql = sql + "b.value_name=? and b.goods_name like ? ";
pstmt = con.prepareStatement(sql);
pstmt.setString(1, value_name);
pstmt.setString(2, goods_name);
}
rs = pstmt.executeQuery();
while(rs.next()){
result = rs.getInt(1);
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
closeConnection();
return result;
}

}

//根據賬單編號獲得賬單詳細信息的方法
@SuppressWarnings("finally")
public Result getBillForBillNumber(long bill_number){
Result result = null;
// 打開資料庫連接
openConnection();
// 編寫SQL語句
String sql = "select b.* from bill_list_view b where b.bill_number="+bill_number;
try {
// 實例化執行SQL語句的對象preparedstatement
stmt = con.createStatement();
// 執行查詢語句並返回結果集
rs = stmt.executeQuery(sql);
// 將結果集儲存在Result對象當中
result = ResultSupport.toResult(rs);
} catch (SQLException e) {
e.printStackTrace();
} finally {
// 關閉資料庫連接及資源
closeConnection();
return result;
}
}

//為賬單增加數據的方法
@SuppressWarnings("finally")
public int updateBill(List<Object> values){
//用於返回執行結果
int result = 0;
// 打開資料庫連接
openConnection();
// 編寫SQL語句
String sql = "insert into bill values (?,?,?,?,?,?,?,?)";
try {
// 實例化執行SQL語句的對象preparedstatement
pstmt = con.prepareStatement(sql);
//設置參數
for(int i=0,j=1;i<values.size();i++,j++){
if(values.get(i) instanceof Integer){
pstmt.setInt(j, (Integer)values.get(i));
}else if(values.get(i) instanceof Long){
pstmt.setLong(j, (Long)values.get(i));
} else if(values.get(i) instanceof String){
pstmt.setString(j, (String)values.get(i));
}else{
pstmt.setDate(j, (Date)values.get(i));
}
}
//獲得執行結果
result = pstmt.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
} finally {
// 關閉資料庫連接及資源
closeConnection();
//返回執行結果
return result;
}
}

//為賬單修改數據的方法
@SuppressWarnings("finally")
public int saveBill(List<Object> values){
//用於返回執行結果
int result = 0;
// 打開資料庫連接
openConnection();
// 編寫SQL語句
String sql = "update bill b set b.goods_name=?,b.goods_number=?,b.transaction_amount=?," +
"b.pay_status=?,b.supplier_number=?,b.goods_description=?,b.bill_date=? where b.bill_number=?";
try {
// 實例化執行SQL語句的對象preparedstatement
pstmt = con.prepareStatement(sql);
//設置參數
for(int i=0,j=1;i<values.size();i++,j++){
if(values.get(i) instanceof Integer){
pstmt.setInt(j, (Integer)values.get(i));
}else if(values.get(i) instanceof Long){
pstmt.setLong(j, (Long)values.get(i));
}else if(values.get(i) instanceof String){
pstmt.setString(j, (String)values.get(i));
}else{
pstmt.setDate(j, (Date)values.get(i));
}
}
//獲得執行結果
result = pstmt.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
} finally {
// 關閉資料庫連接及資源
closeConnection();
//返回執行結果
return result;
}
}

//刪除賬單中數據的方法
@SuppressWarnings("finally")
public int deleteBill(long bill_number){
//用於返回執行結果
int result = 0;
// 打開資料庫連接
openConnection();
// 編寫SQL語句
String sql = "delete bill b where b.bill_number=?";
try {
// 實例化執行SQL語句的對象preparedstatement
pstmt = con.prepareStatement(sql);
//設置參數
pstmt.setLong(1, bill_number);
//獲得執行結果
result = pstmt.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
} finally {
// 關閉資料庫連接及資源
closeConnection();
//返回執行結果
return result;
}
}
}

Ⅸ 基於ssh網上競拍系統源碼,要java tomcat mysql的,注意是競拍的系統,不要簡單的購買

我這有幾套基於javaweb的網上競拍系統源碼, 基礎功能都有實現
項目基於struts2+spring+hibernate進行實現, BS架構, MVC設計模式分層實現, 資料庫採用mysql 還是比較簡單的

Ⅹ 求一個Java的ssh項目源碼

需要的話 可以發給你一份。留下你的郵箱,或者直接加我

熱點內容
for循環sql語句 發布:2025-05-13 22:45:49 瀏覽:17
python實用代碼 發布:2025-05-13 22:19:41 瀏覽:843
dede資料庫的配置文件 發布:2025-05-13 22:19:08 瀏覽:967
給字元加密 發布:2025-05-13 22:12:32 瀏覽:972
資料庫系統實現答案 發布:2025-05-13 22:11:57 瀏覽:141
哪個軟體可以共存安卓 發布:2025-05-13 22:10:15 瀏覽:552
上傳宦妃天下野泉肉肉 發布:2025-05-13 22:10:10 瀏覽:408
洗眼睛解壓 發布:2025-05-13 21:58:28 瀏覽:272
c存儲指針 發布:2025-05-13 21:49:04 瀏覽:922
結繩編程軟體 發布:2025-05-13 21:49:03 瀏覽:851