package gestion_p;
import java.sql.*;

/*
 * 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.
 */

/**
 * Cette classe représente les articles
 * @author mouss
 */
public class Article {
	/*
	* Liste de tous les articles
	*/
    public static ResultSet listeArticles(){
        Connection conn=null;
        Statement st=null;
        ResultSet result=null;
        try{
            Class.forName("com.mysql.jdbc.Driver");
            conn=(Connection)DriverManager.getConnection("jdbc:mysql://localhost:3306/gestion_p","root","moussa");
            st=conn.createStatement();

            String req="SELECT * FROM article";

            result = st.executeQuery(req);
            
            return result;  
            
        }catch(Exception e){
            e.getMessage();
            return null;
        }
    }
}
