public static Stock SelectStockById(int id) throws SQLException {
        String query = "";
        Stock stock = new Stock();
        ResultSet resultat;

        try {
            query = "SELECT * from STOCK  where ID_STOCK=? ";
            PreparedStatement pStatement = ConnectionBDD.getInstance().getPreparedStatement(query);
            pStatement.setInt(1, id);
            resultat = pStatement.executeQuery();

            while (resultat.next()) {
               
              stock = new Stock(resultat.getInt("ID_STOCK"),resultat.getInt("ID_ARTICLE"), resultat.getInt("STSTOCK"), resultat.getInt("STMINI"),resultat.getInt("STMAXI"), resultat.getDate("STDATEMAJ"),resultat.getFloat("STMARGE"),resultat.getFloat("STTTC"));
            }
           
        } catch (SQLException ex) {
            Logger.getLogger(RequetesStock.class.getName()).log(Level.SEVERE, null, ex);

        }
        return stock;
    }