📄 hotelorderbean.java
字号:
package com.wxpn.tutorial.ec.bean;
import java.sql.SQLException;
import java.util.Collection;
import java.util.HashMap;
import com.wxpn.tutorial.ec.util.DBAccess;
public class HotelOrderBean {
private DBAccess db=null;
//state the table' name
private String sTableName="hotelordertable";
public HotelOrderBean() {
db=new DBAccess();
}
public void deleteHotelOrderByKey(int key) throws Exception{
try{
db.performDeleteByKey(sTableName,key);
} catch (Exception e) {
e.printStackTrace();
}
}
public void insertHotelOrder(HashMap map) throws Exception{
try{
db.performInsert(sTableName,map);
}catch(Exception e){
e.printStackTrace();
}
}
public String getAddSeqNum() throws SQLException{
String tablekey="hotelorderid";
String maxid = "0";
db=new DBAccess();
try{
maxid=db.getAddSeqNum(tablekey,sTableName);
}catch(Exception e){
e.printStackTrace();
}
return maxid;
}
public Collection getResultList(){
Collection resultList =null;
try{
resultList=(Collection)db.getAll(sTableName);
}catch(Exception e){
e.printStackTrace();
}
return resultList;
}
public int getCount() {
// 创建数据库连接对象:
String clause =" ";
db=new DBAccess();
try {
int count=db.getCount(sTableName,clause);
return count;
} catch (Exception e) {
e.printStackTrace();
return 0;
}
}
public Collection getAll(int pagesize, int page,String clause) {
Collection resultList=null;
db=new DBAccess();
try {
resultList=(Collection)db.getAll(sTableName,pagesize,page,clause);
return resultList;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -