1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
|
public void windowOpened(WindowEvent evt){
String url = "sqlserver://localhost:1433";
try
{
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
}
catch(Exception e)
{
JOptionPane.showMessageDialog(null,"Impossible de ce connecter au serveur");
}
try
{
Connection con = DriverManager.getConnection(url,"bdcpai",administrateur,"");
Statement st = con.createStatement();
ResultSet QueryNbssd = st.executeQuery("SELECT COUNT orientation FROM personne WHERE orientation = soladirite developpement");
ResultSet QueryNbccas = st.executeQuery("SELECT COUNT orientation FROM personne WHERE orientation = ccas");
ResultSet QueryNbplaquette = st.executeQuery("SELECT COUNT orientation FROM personne WHERE orientation = plaquette");
ResultSet QueryNbadis =st.executeQuery("SELECT COUNT orientation FROM personne WHERE orientation = adis");
ResultSet QueryNbaaj = st.executeQuery("SELECT COUNT orientation FROM personne WHERE orientation = aaj");
ResultSet QueryNbasa = st.executeQuery("SELECT COUNT orientation FROM personne WHERE orientation = asa");
ResultSet QueryNbsc = st.executeQuery("SELECT COUNT orientation FROM personne WHERE orientation = secours catholique");
ResultSet QueryNbudaf = st.executeQuery("SELECT COUNT orientation FROM personne WHERE orientation = udaf");
ResultSet QueryNbfoyeaft= st.executeQuery("SELECT COUNT orientation FROM personne WHERE orientation = foyer aftam");
ResultSet QueryNbapap = st.executeQuery("SELECT COUNT orientation FROM personne WHERE orientation = apap");
ResultSet QueryNblilot= st.executeQuery("SELECT COUNT orientation FROM personne WHERE orientation = lilot");
textssd.setText();
textccas.setText();
textrelaplaque.setText();
textadis.setText();
textaaj.setText();
textasa.setText();
textsc.setText();
textudaf.setText();
textfoyeraft.setText();
textapap.setText();
textlilot.setText();
}
catch(Exception e)
{
JOptionPane.showMessageDialog(null,"DOnnées inaccessible");
}
} |
Partager