?? supplyinfo_maintain.java
字號(hào):
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("執(zhí)行成功!");
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 = "執(zhí)行出錯(cuò)!";
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;
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -