private void cariTotal(int noMeja){
        if (noMeja > 0){
            try {
                Class.forName ("com.mysql.jdbc.Driver");
                String urldb="jdbc:mysql://localhost:3306/restaurant";
                String user=main.dbUser;
                String password=main.dbPassword;
                Connection koneksi=java.sql.DriverManager.getConnection(urldb,user,password);
                String sql = "SELECT "
                            + "SUM(((detail_pesanan.jumlah)*(makanan.harga))) as total "
                            + "FROM "
                            + " detail_pesanan "
                            + " INNER JOIN makanan "
                            + "     ON (detail_pesanan.nama = makanan.nama) "
                            + " INNER JOIN pesanan "
                            + "     ON (pesanan.no_pesanan = detail_pesanan.no_pesanan) "
                            + "WHERE (pesanan.no_meja = "+noMeja+" and lunas = 0)";

                Statement st = koneksi.createStatement();
                ResultSet rs = st.executeQuery(sql);

                while (rs.next()){
                    total_pesanan.setText(rs.getString("total"));
                }
                rs.close();
                st.close();
                koneksi.close();
            }catch(ClassNotFoundException cnfe){
                System.out.println("kesalahan saat"+"me-load driver jdbc \n"+cnfe.getMessage());
            }catch(SQLException sqle){
                System.out.println("keslahan saat koneksi atau "+"kesalahan query sql \n"+sqle.getMessage());
            }   
        }
    }