FileDocCategorySizeDatePackage
PublishTestDbmsJavaSetOutput.javaAPI DocExample716Wed Jun 20 20:02:38 BST 2001None

PublishTestDbmsJavaSetOutput.java

import java.sql.*;

class PublishTestDbmsJavaSetOutput {

  public static void main(String[] argv)
   throws SQLException {
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    String sql = "create or replace procedure TDJSO_main(driver_type varchar2) " + 
                 "as language java " + 
                 "name 'TestDbmsJavaSetOutput.main(java.lang.String[])';";
    Connection conn = DriverManager.getConnection(
     "jdbc:oracle:thin:dssw2k01:1521:orcl", "scott", "tiger");
    Statement  stmt = conn.createStatement(); 
    long       rslt = stmt.executeUpdate(sql);
    if (rslt==0) 
      System.out.println("OK");
    stmt.close();
    conn.close();
  }
}