medicamentSQL fini
jffMedicament début
This commit is contained in:
@@ -4,10 +4,60 @@
|
||||
*/
|
||||
package acces_aux_donnes;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
/**
|
||||
*
|
||||
* @author emile.lalorcey
|
||||
*/
|
||||
public class MedicamentSQL {
|
||||
private Connection connexionTest;
|
||||
private Statement stmt = null;
|
||||
private ResultSet result = null;
|
||||
|
||||
public MedicamentSQL() {
|
||||
connexionTest = connexionSQL.getConnect("10.121.38.75","bdgsb","adminGSB","mdpGSB");
|
||||
}
|
||||
|
||||
public ArrayList<String> rechercherMedicament (String idMedoc){
|
||||
ArrayList<String> infoMedoc = new ArrayList<String>();
|
||||
|
||||
try {
|
||||
stmt = connexionTest.createStatement();
|
||||
// Acc<63>s <20> la table
|
||||
result = stmt.executeQuery("SELECT * FROM MEDICAMENT WHERE mDepotLegal ='"+idMedoc+"';");
|
||||
if(result.next()){
|
||||
infoMedoc.add(result.getString(1));
|
||||
infoMedoc.add(result.getString(2));
|
||||
infoMedoc.add(result.getString(3));
|
||||
infoMedoc.add(result.getString(4));
|
||||
infoMedoc.add(result.getString(5));
|
||||
infoMedoc.add(result.getString(6));
|
||||
}
|
||||
result.close();
|
||||
stmt.close();
|
||||
}catch (SQLException ex) {
|
||||
System.out.println("SQLException : " + ex.getMessage());
|
||||
System.out.println("SQLState : " + ex.getSQLState());
|
||||
System.out.println("Code erreur : " + ex.getErrorCode());
|
||||
}
|
||||
return infoMedoc;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user