import java.sql.*;  import java.io.FileInputStream;  import java.util.Properties;
class JdbcCallInOutProc {
 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);

  CallableStatement call = conn.prepareCall("{call ChangePop(?,?,?)}");
  call.registerOutParameter(2,java.sql.Types.NUMERIC);
  call.registerOutParameter(3,java.sql.Types.NUMERIC);
  call.setString(1,"D");        // country code
  call.setInt(2,80000000);      // new population
  call.execute();
  System.out.println(call.getInt(2));   // old population
  System.out.println(call.getFloat(3)); // density
  conn.close();
}}
