package test;
import java.sql.*;
import java.lang.*;public class Untitled1 {  public static void main(String[] args)
  {
    try{//Load the driver
      Class.forName("oracle.jdbc.driver.OracleDriver");
    }catch(Exception e)
     {
       System.out.println("Could not load driver:"+e);
       System.exit(-1);
     }    try{
      Connection conn = DriverManager.getConnection(
          "jdbc:oracle:thin:scott/[email protected]:1521:orcl");
      Statement stmt = conn.createStatement();
      ResultSet rs = stmt.executeQuery("select ename,deptno from emp");      while(rs.next())
      {
      System.out.println(rs.getString(1) + "\t" + rs.getString(2));
      }    }catch(Exception e)
    {
      System.out.println("ERROR");
    }  }}