⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 planeorderbean.java

📁 这是jsp通用模块导航的程序原代码,里面有新闻,bbs等jsp与javabean结合的程序.
💻 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 PlaneOrderBean {
	private DBAccess db=null;
    //state the table' name
    private String sTableName="planeordertable";
	
	public void PlaneOrderBean()  {
	
		
	}
	
	 public void deletePlaneInfoBykey(int key) throws Exception{
			
			db=new DBAccess();
			try{
				db.performDeleteByKey(sTableName,key);
			} catch (Exception e) {
				e.printStackTrace();
			}
	}
	 
	 public void insertPlaneOrder(HashMap map) throws Exception{
			
			db=new DBAccess();
			try{
	
				db.performInsert(sTableName,map);
			}catch(Exception e){

					e.printStackTrace();
			
			}
	}
	 
	 public String getAddSeqNum() throws SQLException{
         
		 String tablekey="planeorderid";
		 String maxid = "1";  
			
     try{
    	 db=new DBAccess();
    	maxid=db.getAddSeqNum(tablekey,sTableName);
        System.out.println(maxid);
     }catch (Exception e){
		 e.printStackTrace();
			
	}  

	  return maxid;  
 }
   public Collection getResultList(){
 
		Collection  resultList =null;
		db=new DBAccess();
		 try{
	
		
		 resultList=(Collection)db.getAll(sTableName);
		 
     }catch(Exception e){
	  e.printStackTrace();	 
	 }
	   return resultList;
     }
	 
	 public Collection getResultList(String clause){
		 
		 Collection  resultList =null;
			db=new DBAccess();
		 try{
		
		 resultList=(Collection)db.getAllByClause(sTableName,clause);
		 
     }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 + -