FileDocCategorySizeDatePackage
TestDbmsJavaSetOutput.javaAPI DocExample796Wed Jun 20 19:49:44 BST 2001None

TestDbmsJavaSetOutput

public class TestDbmsJavaSetOutput extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

    Class.forName("oracle.jdbc.driver.OracleDriver");
    String greeting = null;
    Connection conn = DriverManager.getConnection(
     "jdbc:oracle:" + args[0] + ":", "scott", "tiger");
    Statement  stmt = conn.createStatement();
    ResultSet  rset = stmt.executeQuery(
     "select 'Hello '||initcap(USER)||'!' result from dual");
    if (rset.next()) 
     greeting = rset.getString(1);
    rset.close();
    stmt.close();
    CallableStatement cstmt = conn.prepareCall(
     "{ call SYS.DBMS_JAVA.SET_OUTPUT( 10000 ) }");
    cstmt.execute();
    cstmt.close();
    conn.close();
    System.out.println(greeting);