net.sf.fikin.sql.oracle
Class SetServerOut

java.lang.Object
  extended by net.sf.fikin.sql.SQLPipeElement
      extended by net.sf.fikin.sql.oracle.SetServerOut

public class SetServerOut
extends SQLPipeElement

A pipe element enabling Oracle's DBMS_OUTPUT package

It uses JdbcConnection to create a CallableStatement.

created on Dec 16, 2006

Since:
Version:
$Revision: 1.3 $
Author:
fiykov

Constructor Summary
SetServerOut()
          create an dbms_output mode setting pipe element by default it is enabled
SetServerOut(boolean echoOn)
          create an dbms_output mode setting pipe element
 
Method Summary
protected  java.sql.CallableStatement createStmt(java.lang.String sql)
          instantiates a CallableStatement with given sql command
 void execute(java.lang.String cmd)
          switch on/off the server out (oracle's dbms_output)
 boolean getServerOutOn()
          is server out (dbms_output) on
 void setServerOutOn(boolean outOn)
          set echo on/off
protected  void switchItOff()
          disable the server out via JDBC CallableStatement
protected  void switchItOn()
          enable the server out via JDBC CallableStatement
 
Methods inherited from class net.sf.fikin.sql.SQLPipeElement
getBaseClassName, getId, getNext, getPipe, setNext, setPipe
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SetServerOut

public SetServerOut()
create an dbms_output mode setting pipe element by default it is enabled


SetServerOut

public SetServerOut(boolean echoOn)
create an dbms_output mode setting pipe element

Method Detail

getServerOutOn

public boolean getServerOutOn()
is server out (dbms_output) on

Returns:
true if echo is on

setServerOutOn

public void setServerOutOn(boolean outOn)
set echo on/off

Parameters:
outOn -

execute

public void execute(java.lang.String cmd)
             throws java.sql.SQLException
switch on/off the server out (oracle's dbms_output)

Specified by:
execute in class SQLPipeElement
Parameters:
cmd - to execute
Throws:
java.sql.SQLException - in case of error

switchItOn

protected void switchItOn()
                   throws java.sql.SQLException
enable the server out via JDBC CallableStatement

Throws:
java.sql.SQLException

switchItOff

protected void switchItOff()
                    throws java.sql.SQLException
disable the server out via JDBC CallableStatement

Throws:
java.sql.SQLException

createStmt

protected java.sql.CallableStatement createStmt(java.lang.String sql)
                                         throws java.sql.SQLException
instantiates a CallableStatement with given sql command

Parameters:
sql -
Returns:
callable statement
Throws:
java.sql.SQLException


Copyright © 2003-2007 Nikolay Fiykov. All Rights Reserved.