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

📄 supplyinfo_maintain.java

📁 JSP移动商品管理平台源代码.........
💻 JAVA
字号:
package imis_mate;
// Download by http://www.codefans.net
import java.io.*;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Hashtable;
import database.DBPoolManager;

public class supplyInfo_maintain {
        
			
		  int supplyNo;
		  String supplyName;
		  String tele;
		  String addr;
		  String attPerson;
		  String acccount;
		  String bank;
		  String remark;
		  String action;
		  byte   temp[];
		
		 
		 /**
		 * @return the acccount
		 */
		public String getAcccount() {
			return acccount;
		}
		/**
		 * @return the addr
		 */
		public String getAddr() {
			return addr;
		}
		/**
		 * @return the attPerson
		 */
		public String getAttPerson() {
			return attPerson;
		}
		/**
		 * @return the bank
		 */
		public String getBank() {
			return bank;
		}
		/**
		 * @return the remark
		 */
		public String getRemark() {
			return remark;
		}
		/**
		 * @return the supplyName
		 */
		public String getSupplyName() {
			return supplyName;
		}
		/**
		 * @return the supplyNo
		 */
		public int getSupplyNo() {
			return  this.supplyNo;
		}
		/**
		 * @return the tele
		 */
		public String getTele() {
			return tele;
		}
		/**
		 * @param acccount the acccount to set
		 */
		public void setAcccount(String acccount) {
			this.acccount = ISOtoGB(acccount);
		}
		/**
		 * @param addr the addr to set
		 */
		public void setAddr(String addr) {
			this.addr = ISOtoGB(addr);
		}
		/**
		 * @param attPerson the attPerson to set
		 */
		public void setAttPerson(String attPerson) {
			this.attPerson = ISOtoGB(attPerson);
		}
		/**
		 * @param bank the bank to set
		 */
		public void setBank(String bank) {
			this.bank = ISOtoGB(bank);
		}
		/**
		 * @param remark the remark to set
		 */
		public void setRemark(String remark) {
			this.remark = ISOtoGB(remark);
		}
		/**
		 * @param supplyName the supplyName to set
		 */
		public void setSupplyName(String supplyName) {
			this.supplyName = ISOtoGB(supplyName);
		}
		/**
		 * @param supplyNo the supplyNo to set
		 */
		public void setSupplyNo(int supplyNo) {
			this.supplyNo = supplyNo;
		}
		/**
		 * @param tele the tele to set
		 */
		public void setTele(String tele) {
			this.tele = ISOtoGB(tele);
		}
		/**
		 * @param supplyNo
		 * @param supplyName
		 * @param tele
		 * @param addr
		 * @param attPerson
		 * @param acccount
		 * @param bank
		 * @param remark
		 */
		
		public String ISOtoGB(String in){
			String out = "";
			if (in == null){
				return "";
			}
			else{
	    			try {
		
	    				out = new String(in.getBytes("iso-8859-1"),"gb2312");
					return out;    					
	    			} 
	    			catch (UnsupportedEncodingException e) {

	    				e.printStackTrace();
	    			}
	    		}
	    		return out; 		
	        } 
		public String GBtoISO(String in){
			String out = "";
			if (in == null){
				return "";
			}
			else{
	    			try {
		
	    				out = new String(in.getBytes("gb2312"),"iso-8859-1");
					return out;    					
	    			} 
	    			catch (UnsupportedEncodingException e) {

	    				e.printStackTrace();
	    			}
	    		}
	    		return out;		
	        }           

	
        public String processthis(){
        	String result= new String("执行成功!");
		DBPoolManager dbpool = new DBPoolManager();
		dbpool.getConnection();	
		try {
			String    sql  = null;
			Statement stmt = dbpool.conn.createStatement();
			ResultSet rest = null;
			
			
		//	 supplyNo  supplyName	tele	addr	 attPerson	 acccount	 bank	 remark

			if (action.equals("mod")) {        
             	             	sql="update supply set supplyName='"+supplyName
				+"', tele='"+tele
				+"', addr='"+addr
				+"', attPerson='"+attPerson
				+"', acccount='"+acccount
				+"', bank='"+bank
				+"', remark='"+remark
				+"'  where supplyNo='"+supplyNo+"'";
				stmt.executeUpdate(sql);
             		}
			
             		else if (action.equals("add")){
             		
             	             	sql="insert into supply(supplyNo, supplyName,tele,addr, attPerson, acccount, bank,remark)values(supplyNo.NextVal,'"+supplyName
				+"','"+tele
				+"','"+addr
				+"','"+attPerson
				+"','"+acccount
				+"','"+bank
				+"','"+remark
				+"')";
				stmt.executeUpdate(sql);
             		}
			// supplyNo  supplyName	tele	addr	 attPerson	 acccount	 bank	 remark
			
			 else if (action.equals("del")){
				
             	         sql="delete from  supply where supplyNo='"+supplyNo+"'";             
						
             	             			stmt.close();
						stmt = dbpool.conn.createStatement();
             	             			stmt.executeUpdate(sql);		
			 }
					
													
             		 												
             		stmt.close();
		} catch (SQLException ex) {
			result = "执行出错!";
			System.err.println("Get organ_maintain SQLException: " + ex.toString());
		} finally {
			dbpool.freeConnection();
		}
		return result;	
	}
		public String getAction() {
			return action;
		}
		public void setAction(String action) {
			this.action = action;
		} 
}        	

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -