Sales Report
Sales Report
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import javax.swing.JOptionPane;
/**
* @author Admin
*/
int code=0;
int or=0;
String name="";
int orderNum=0;
double pr = 0.00;
String date="";
String cashier="";
try{
Class.forName(connector.driver);
ResultSet rs = st.executeQuery(sql);
while (rs.next()){
code = rs.getInt(1);
st.execute(sql);
st.close();
con.close();
rs.close();
}catch(Exception e){
JOptionPane.showMessageDialog(null, e);
public reportsales(int or, String name, int orderNum, double pr, String date, String cashier){
this.or=or;
this.name=name;
this.orderNum=orderNum;
this.pr=pr;
this.date=date;
this.cashier=cashier;
count();
autoSave();
}
public void autoSave(){
try{
Class.forName(connector.driver);
Statement st = con.createStatement();
st.execute(sql);
st.close();
con.close();
}catch(Exception e){
JOptionPane.showMessageDialog(null, e);