FileDocCategorySizeDatePackage
CallTestInternalConnection.javaAPI DocExample573Mon Oct 30 17:24:18 GMT 2000None

CallTestInternalConnection.java

import java.sql.*;

class CallTestInternalConnection {

 public static void main(String[] argv)
  throws SQLException {
  DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
  Connection conn = DriverManager.getConnection(
    "jdbc:oracle:thin:dssw2k01:1521:orcl", "scott", "tiger");
  CallableStatement cstmt = conn.prepareCall("{?= call TIC_getGreeting}");
  cstmt.registerOutParameter(1, Types.CHAR);
  long rslt = cstmt.executeUpdate();
  if (rslt>0) 
   System.out.println(cstmt.getString(1));
  cstmt.close();
  conn.close();
 }
}