freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

基于web開發(fā)的圖書銷售系統(tǒng)的設(shè)計(jì)與實(shí)現(xiàn)-資料下載頁

2025-06-19 12:41本頁面
  

【正文】 tch block ()。 } }}package 。import 。import 。import 。import 。import 。import 。import 。import 。import 。public class JDBCTemplate { DBManager dbManager = new DBManager()。//創(chuàng)建DBManager /*數(shù)據(jù)查詢*/ public Object[] query(String sql, Object[] args, Class clazz) {//sql是查詢語句,args是存放參數(shù),根據(jù)clazz可用反射自動(dòng)封裝成vo Object[] obj = null。 Connection conn = ()。//得到一個(gè)Connection PreparedStatement pstmt = null。 ResultSet rs = null。 try { pstmt = (sql)。//獲得preparedStatement if(args != null) { setParameters(pstmt, args)。//設(shè)置參數(shù) } rs = ()。//執(zhí)行命令,返回結(jié)果集 obj = mapRow(rs, clazz)。//封裝結(jié)果集 } catch (SQLException e) { ()。 } finally { (conn,pstmt,rs)。//釋放資源 } return obj。 } /*數(shù)據(jù)查詢*/ /*sql是查詢語句,args是存放參數(shù),用戶可用setp自定義設(shè)置怎樣傳參,根據(jù)clazz可用反射技術(shù)自動(dòng)封裝成vo*/ public Object[] query(String sql, Object[] args, SetParameters setp, Class clazz) { Object[] obj = null。 Connection conn = ()。 PreparedStatement pstmt = null。 ResultSet rs = null。 try { pstmt = (sql)。 if(args != null) { (pstmt, args)。 } rs = ()。 obj = mapRow(rs, clazz)。 } catch (SQLException e) { ()。 } finally { (conn,pstmt,rs)。 } return obj。 } /*數(shù)據(jù)查詢*/ /*sql是查詢語句,args是存放參數(shù),rowMap是用戶自定義封裝結(jié)果集*/ public Object[] query(String sql, Object[] args, RowMapper rowMap) { Object[] obj = null。 Connection conn = ()。 PreparedStatement pstmt = null。 ResultSet rs = null。 try { pstmt = (sql)。 if(args != null){ setParameters(pstmt,args)。 } rs = ()。 obj = (rs)。 } catch (SQLException e) { ()。 }finally{ (conn,pstmt,rs)。 } return obj。 } /*數(shù)據(jù)更新、增加、刪除*/ public boolean update(String sql, Object[] args) { Connection conn = ()。 PreparedStatement pstmt = null。 try {(sql)。 pstmt = (sql)。 if(args != null) { setParameters(pstmt, args)。 } ()。 } catch (SQLException e) { ()。 return false。 } finally { (conn,pstmt)。 } return true。 } /*用來傳參*/ private void setParameters(PreparedStatement pstmt, Object[] obj) { try { for (int i = 0。 i 。 i++) { if (obj[i].getClass().getName().equals()) { (i + 1, obj[i].toString())。 } else if (obj[i].getClass().getName().equals()) { (i + 1, (obj[i].toString()))。 } else if (obj[i].getClass().getName().equals()){ (i+1, (obj[i].toString()))。 } else if (obj[i].getClass().getName().equals()) { (i+1,new Date((()obj[i]).getTime()))。 } else if (obj[i].getClass().getName().equals()) { (i+1, (obj[i].toString()))。 } else if(obj[i].getClass().getName().equals(int)) { (i+1, (obj[i].toString()))。 } else if(obj[i].getClass().getName().equals(float)) { (i+1, (obj[i].toString()))。 } else if(obj[i].getClass().getName().equals(double)) { (i+1, (obj[i].toString()))。 } /*else if(obj[i].getClass().getName().equals(byte[])) { (i+1, obj[i].toString())。 }*/ } } catch (SQLException e) { ()。 } } /*封裝結(jié)果集*/ private Object[] mapRow(ResultSet rs, Class c) { Object[] objArray = null。 Object obj。 ListObject info = new ArrayListObject()。 Class type = null。 // 屬性類型 Method[] methods = ()。//反射,得到c中所有的方法 try { ResultSetMetaData md = ()。//得到結(jié)果集里所有的數(shù)據(jù) while (()) { obj = ()。//創(chuàng)建實(shí)例 for (int i = 0。 i ()。 i++) { for (int j = 0。 j 。 j++) { if (methods[j].getName().equalsIgnoreCase( set + (i + 1))) { //methods[j].invoke(obj, (i + 1))。 for (int k = 0。 k 。 k++) { if (methods[k].getName().equalsIgnoreCase( get + (i + 1))) { type = methods[k].getReturnType()。 break。 } } if(().equals()) { methods[j].invoke(obj, (i+1))。 } if(().equals()) { methods[j].invoke(obj, (i+1))。 } if (().equals()) { methods[j].invoke(obj, (i+1))。 } if (().equals()) { methods[j].invoke(obj, (i+1))。 } if (().equals()) { methods[j].invoke(obj, (i + 1))。 } if (().equals()) { methods[j].invoke(obj, (i + 1))。 } if (().equals(char)) { methods[j].invoke(obj, (i + 1))。 } if (().equals(int)) { methods[j].invoke(obj, (i + 1))。 } if (().equals(float)) { methods[j].invoke(obj, (i + 1))。 } if (().equals(double)) { methods[j].invoke(obj, (i + 1))。 } } } } (obj)。 } } catch (Exception e) { ()。 } if (()0) { objArray = new Object[()]。 for (int i = 0。 i ()。 i++) { objArray[i] = (i)。 } } return objArray。 }}package 。import 。public class ConsumerVO { private String ame。 private String cpassword。 private String 。 private String sex。 private Date birthday。 private String hobby。 private String address。 private String beizhu。 public String getCname() { return ame。 } public void setCname(String ame) { = ame。 } public String getCpassword() { return cpassword。 } public void setCpassword(String cpassword) { = cpassword。 } public String getEmail() { return 。 } public void setEmail(String ) { = 。 } public String getSex() { return sex。 } public void setSex(String sex) { = sex。 } public Date getBirthday() { return birthday。 } public void setBirthday(Date birthday) { = birthday。 } public String getHobby() { return hobby。 } public void setHobby(String hobby) { = hobby。 } public String getAddress() { return address。 } public void setAddress(String address) { = address。 } public String getBeizhu() {
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評(píng)公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1