import java.sql.*;

class DBTest
{
  public static void main (String args [])
       throws SQLException
  {
    // Load the Oracle JDBC driver
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

    Connection conn =
      DriverManager.getConnection ("jdbc:oracle:thin:@pdc-lab:1521:" +
					args[0],
					args[1],
					args[2]);

    // Create a Statement
    Statement stmt = conn.createStatement ();

    // Select the ENAME column from the EMP table
    ResultSet rset = stmt.executeQuery (args[3]);

    // Iterate through the result and print the employee names
    while (rset.next ())
      System.out.println (rset.getString(1)+' '+rset.getString(2));
  }
}

