📄 restaurantmenu41.java
字号:
package restaurant;
import java.io.*;
import java.sql.*;
import javax.swing.JOptionPane;
import java.util.Vector;
public class RestaurantMenu41{
private DBCon con;
private Read read;
private Exit exit;
private Common common;
ResultSet rs=null;
public void selectFoodInfo(String customerType){
String sql="select * from sales where foodType='"+customerType+"'";
con = new DBCon();
read = new Read(con.getConnection());
rs=read.executeQuery(sql);
}
public int getFoodInfo(){
int total=0;
try{
while(rs.next()){
total+=rs.getInt("amount") * rs.getInt("pay");
}
}catch(SQLException e){
System.err.println(e.getMessage());
}
exit = new Exit(con.getConnection());
exit.Close();
return total;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -