enable Oracle dbms output - Java JDBC

Java examples for JDBC:Oracle

Description

enable Oracle dbms output

Demo Code


//package com.java2s;
import java.sql.CallableStatement;
import java.sql.Connection;

public class Main {
    public static void enable_dbms_output(Connection conn, int buffer_size) {
        System.out.print("Enabling DBMS_OUTPUT - ");
        try {//  ww  w  .  j  a va2 s .com
            CallableStatement stmt = conn
                    .prepareCall("{call sys.dbms_output.enable(?) }");
            stmt.setInt(1, buffer_size);
            stmt.execute();
            System.out.println("Enabled!");
        } catch (Exception e) {
            System.out
                    .println("Problem occurred while trying to enable dbms_output! "
                            + e.toString());
        }
    }
}

Related Tutorials