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
| try{
Class leDriver=Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con = DriverManager.getConnection("jdbc:oracle:oci8:@5chiij:1521:orcl10g","MonLogin","MonMotDePasse");
System.out.println("on est connecté a la base oracle");
Statement instruc = con.createStatement();
//System.out.println("SQLWarning: "+instruc.getWarnings().toString());
System.out.println("on a fait le createstatement");
rs = instruc.executeQuery("select * from tab");
System.out.println("on a fait le select"); <-- ne s'exécute jamais
while(rs.next())
{
// lesJoueurs[cpt] = new sJoueur();
// lesJoueurs[cpt].NomJou = rs.getString("NomJou");
System.out.println("on est dans la boucle");
cpt++;
}
}
catch(ClassNotFoundException exc)
{
exc.printStackTrace();
System.out.println("Exception " + exc);
}
catch(SQLException exc)
{
System.out.println("Exception: "+ exc);
System.exit(0);
} |