routeorderbean.java
来自「这是jsp通用模块导航的程序原代码,里面有新闻,bbs等jsp与javabean」· Java 代码 · 共 97 行
JAVA
97 行
package com.wxpn.tutorial.ec.bean;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import com.wxpn.tutorial.db.ConnectionPool;
import com.wxpn.tutorial.db.DB;
import com.wxpn.tutorial.ec.util.DBAccess;
import com.wxpn.tutorial.ec.util.StringUtil;
import com.wxpn.tutorial.ec.util.TravValueMapBean;
public class RouteOrderBean {
private DBAccess db=null;
//state the table' name
private String sTableName="routeordertable";
public RouteOrderBean() {
db=new DBAccess();
}
public void deleteRouteOrderByKey(int key) throws Exception{
try{
db.performDeleteByKey(sTableName,key);
} catch (Exception e) {
e.printStackTrace();
}
}
public void insertRouteOrder(HashMap map) throws Exception{
try{
db.performInsert(sTableName,map);
}catch(Exception e){
e.printStackTrace();
}
}
public String getAddSeqNum() throws SQLException{
String tablekey="routeorderid";
String maxid = "1";
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 + =
减小字号Ctrl + -
显示快捷键?