import java.sql.*;
class dbAccess {
public static void main (String args []) throws SQLException
{
try {
Class.forName ("oracle.jdbc.driver.OracleDriver");
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
Connection conn = DriverManager.getConnection
("jdbc:oracle:oci8:", "prueba", "prueba");
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery("select codigo, descripcion FROM prueba");
while (rset.next())
System.out.println (rset.getString(1));
System.out.println (rset.getString(2));
stmt.close();
}
}