/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package interfacePharmacie;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

/**
 *
 * @author LENOVO
 */

public class ActualisationSolde {
   public static String actuelSolde; 
    
    public static void refreshSolde (){
        try {
            BDPharmacie bd = new BDPharmacie();
            Connection connex = bd.connectToBD();
            String sql ="SELECT * FROM pharmacie WHERE id_pharmacie = ?";
            PreparedStatement stm = connex.prepareStatement(sql);
            stm.setInt(1, InterfaceLogin.idPharmacie);
            ResultSet rs = stm.executeQuery();
            
            while (rs.next()){
                actuelSolde = rs.getString("montant_pharmacie");
                
            }
             
            
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    
}
