import java.sql.*;
import java.io.FileInputStream;
import java.util.Properties;
class JdbcSelect {
  public static void main (String args []) throws Exception {
  DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
  Properties props = new Properties();
  props.load(new FileInputStream("conn.props"));
  Connection conn = DriverManager.getConnection(props.getProperty("url"), props);
  Statement stmt = conn.createStatement();
  ResultSet rset = stmt.executeQuery("SELECT * FROM " + args[0]);
   ResultSetMetaData rsetmetadata = rset.getMetaData();
  int numCols = rsetmetadata.getColumnCount();
  while (rset.next()) {
    for(int i=1; i<=numCols; i++) {
      String value = rset.getString(i);
      if (rset.wasNull()) System.out.print("null");
         else System.out.print(value);
      System.out.print("  ");
    }
    System.out.println();
  }
  rset.close(); stmt.close(); conn.close();
}}
