import java.sql.*;
import java.io.*;
import java.util.Date;
class JdbcTest
{
public static void main (String args [])
throws SQLException, IOException
{
System.out.println ("Loading Oracle JDBC OCI driver");
try
{
Class.forName ("oracle.jdbc.OracleDriver");
}
catch (ClassNotFoundException e)
{
System.out.println ("Could not load the driver");
e.printStackTrace ();
}
System.out.println ("Connecting to the local database");
Connection conn =
DriverManager.getConnection ("jdbc:oracle:scott/tiger");
Statement stmt = conn.createStatement ();
// Query the employee names
ResultSet rset = stmt.executeQuery ("select ename from emp");
while (rset.next ())
{
// Print the name out
System.out.println (rset.getString (1));
}
}
}