//------------------------------------------------------------------------------
// ExFamiliarisationCurseur.java
//------------------------------------------------------------------------------

// Utilise la table suivante.
/*
drop table personne;
create table personne(nom varchar2(10), age integer);
insert into personne values('Riton', 23);
insert into personne values('Rita', 22);
select * from personne;
*/

//------------------------------------------------------------------------------

import java.sql.*;

class ExFamiliarisationCurseur {
    public static void main(String[] args)
	throws SQLException, ClassNotFoundException {

	Class.forName("oracle.jdbc.driver.OracleDriver");
	Connection c = DriverManager.getConnection(
            "jdbc:oracle:thin:waller_a/AQWzsx34@servora:1521:dbinfo");

	String texte = "select nom, age from personne";
	System.out.println(texte);

	Statement s = c.createStatement();
	ResultSet r = s.executeQuery(texte);
	while (r.next())
	    System.out.println(r.getString(1)+", "+r.getInt(2)+" ans");
	r.close();
	s.close();
	c.close();
    }
}

//------------------------------------------------------------------------------
