📄 companyaccount.java
字号:
//Source file: D:\work\五洋\javaBean\src\CompanyAccount.java
package src.wuyang;
import src.com.*;
import java.sql.*;
import java.io.*;
public class CompanyAccount extends ShangObject
{
/**
公司编号
*/
private String companyId;
/**
开户银行
*/
private String bank;
/**
银行帐号
*/
private String bankAccount;
private int id;
public CompanyAccount()
{
primarykey1Name = "companyId";
primarykey1Type = 1;
tableName = "CompanyAccount";
viewName = "CompanyAccount";
numInOnePager = 10;
}
public int loadAttr() {
try{
id = rs.getInt("id");
companyId = getRsString(rs,"companyId");
bank = getRsString(rs,"bank");
bankAccount = getRsString(rs,"bankAccount");
return 1;
}catch(SQLException e){
print(e.getMessage());
e.printStackTrace();
return -1;
}
}
public int insert() {
String sql= "{?=call sp_InsertCompanyAccount(?,?,?,?,?,?)}";
try{
CallableStatement updStmt=conn.prepareCall(sql);
updStmt.registerOutParameter(1, java.sql.Types.INTEGER);
setStmtString(updStmt, 2, theGlobal.loginName);
setStmtString(updStmt, 3, theGlobal.ip);
setStmtString(updStmt, 4, theGlobal.machineName);
setStmtString(updStmt,5,companyId);
setStmtString(updStmt,6,bank);
setStmtString(updStmt,7,bankAccount);
updStmt.executeUpdate();
int rtcode = updStmt.getInt(1);
updStmt.close();
return rtcode;
}catch(SQLException e){
System.out.println(e.getMessage());
e.printStackTrace();
return -1;
}
}
public int update() {
String sql= "{?=call sp_UpdateCompanyAccount(?,?,?,?,?,?)}";
try{
CallableStatement updStmt=conn.prepareCall(sql);
updStmt.registerOutParameter(1, java.sql.Types.INTEGER);
setStmtString(updStmt, 2, theGlobal.loginName);
setStmtString(updStmt, 3, theGlobal.ip);
setStmtString(updStmt, 4, theGlobal.machineName);
updStmt.setInt(5,id);
setStmtString(updStmt,6,bank);
setStmtString(updStmt,7,bankAccount);
updStmt.executeUpdate();
int rtcode = updStmt.getInt(1);
updStmt.close();
return rtcode;
}catch(SQLException e){
System.out.println(e.getMessage());
e.printStackTrace();
return -1;
}
}
/**
* Access method for the companyId property.
*
* @return the current value of the companyId property
*/
public String getCompanyId() {
return companyId;}
/**
* Sets the value of the companyId property.
*
* @param aCompanyId the new value of the companyId property
*/
public void setCompanyId(String aCompanyId) {
companyId = setChnString(aCompanyId);}
/**
* Access method for the bank property.
*
* @return the current value of the bank property
*/
public String getBank() {
return bank;}
/**
* Sets the value of the bank property.
*
* @param aBank the new value of the bank property
*/
public void setBank(String aBank) {
bank = setChnString(aBank);}
/**
* Access method for the bankAccount property.
*
* @return the current value of the bankAccount property
*/
public String getBankAccount() {
return bankAccount;}
/**
* Sets the value of the bankAccount property.
*
* @param aBankAccount the new value of the bankAccount property
*/
public void setBankAccount(String aBankAccount) {
bankAccount = setChnString(aBankAccount);}
public int getId(){
return id;}
public void setId(int aId) {
id=aId;}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -