📄 dealbill.java
字号:
package util;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Vector;
import beans.Bill;
import beans.Order;
public class DealBill {
Vector<Bill> bills = new Vector<Bill>();
public String generateBills(){
BaseSQL b = new BaseSQL();
try{
b.connect("eatery","root","123456");
ResultSet rs = b.statement.executeQuery("select * from bill where type = 1");
while(rs.next()){
Bill addBill = new Bill();
addBill.getData(rs.getString(1));
bills.add(addBill);
}
} catch (SQLException e) {
// TODO Auto-generated catch block
return "数据库操作出错!";
} catch (Exception e) {
// TODO Auto-generated catch block
return "出现未知错误!";
} finally {
try {
b.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
}
}
return null;
}
public Vector<Bill> getBills() {
return bills;
}
public void setBills(Vector<Bill> bills) {
this.bills = bills;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -