at.glawar
GlawarDataAdapter [2006-07-04]

at.glawar.dbcommunication
Class DBCOracle

java.lang.Object
  extended byat.glawar.dbcommunication.DBCOracle

public class DBCOracle
extends Object

provides methods for doing some special things about oracle.

at the moment you can call procedures and functions whereas functions are supported that only returns ONE parameter and the parameter is of one of the following types:

Since:
2006-03-22
Version:
$Revision: 1.6 $ ($Date: 2006/06/01 18:28:36 $)
Author:
DI Franz-Peter Glawar last modified by: $Author: frahunz $, software.glawar.at

Constructor Summary
DBCOracle(Connection con)
          initializes a new instance of DBCOracle.
 
Method Summary
 Date callDBDATEFunction(String strFunctionName, Object[] oaParameters, String strDBPrefix, Date dDefaultValue)
          Execute a function with a variable amount of parameters.
 BigDecimal callDBNUMBERFunction(String strFunctionName, Object[] oaParameters, String strDBPrefix, BigDecimal bdDefaultValue)
          Execute a function with a variable amount of parameters.
 void callDBProcedure(String strProcedureName, Object[] oaParameters, String strDBPrefix)
          Calls a db-procedure with a variable amount of parameters.
 String callDBVARCHAR2unction(String strFunctionName, Object[] oaParameters, String strDBPrefix, String strDefaultValue)
          Execute a function with a variable amount of parameters.
static String formatSQLDDateParam(Date dValue)
          format a java.util.Date to a String that can be used by Oracle.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBCOracle

public DBCOracle(Connection con)

initializes a new instance of DBCOracle.

Parameters:
con - connection for the oracle database
Since:
2006-03-22
Method Detail

formatSQLDDateParam

public static final String formatSQLDDateParam(Date dValue)

format a java.util.Date to a String that can be used by Oracle.

Parameters:
dValue - java.util.Date that should be formatted into Oracle-format
Returns:
Oracle-usable-format
Since:
2006-03-22

callDBProcedure

public void callDBProcedure(String strProcedureName,
                            Object[] oaParameters,
                            String strDBPrefix)
                     throws SQLException

Calls a db-procedure with a variable amount of parameters.

Parameters:
strProcedureName - name of the procedure without database prefix (e. g. PACKAGENAME.procedureName)
oaParameters - Object-array containing all the parameters, can be null as well, which means no-parameter-at-all
strDBPrefix - database Prefix, not null
Throws:
Exception - if an error occured
SQLException
Since:
2006-03-22

callDBNUMBERFunction

public BigDecimal callDBNUMBERFunction(String strFunctionName,
                                       Object[] oaParameters,
                                       String strDBPrefix,
                                       BigDecimal bdDefaultValue)
                                throws SQLException

Execute a function with a variable amount of parameters.

Parameters:
strFunctionName - name of the function without database prefix (e. g. PACKAGENAME.functionName)
oaParameters - Object-array containing all the parameters, can be null as well, which means no-parameter-at-all
strDBPrefix - database Prefix, not null
bdDefaultValue - default value
Returns:
the BigDecimal-result of the function if the function just returns ONE value
Throws:
SQLException - if an error occured
Since:
2006-03-22

callDBVARCHAR2unction

public String callDBVARCHAR2unction(String strFunctionName,
                                    Object[] oaParameters,
                                    String strDBPrefix,
                                    String strDefaultValue)
                             throws SQLException

Execute a function with a variable amount of parameters.

Parameters:
strFunctionName - name of the function without database prefix (e. g. PACKAGENAME.functionName)
oaParameters - Object-array containing all the parameters, can be null as well, which means no-parameter-at-all
strDBPrefix - database Prefix, not null
strDefaultValue - default value
Returns:
the String-result of the function if the function just returns ONE value
Throws:
SQLException - if an error occured
Since:
2006-03-22

callDBDATEFunction

public Date callDBDATEFunction(String strFunctionName,
                               Object[] oaParameters,
                               String strDBPrefix,
                               Date dDefaultValue)
                        throws SQLException

Execute a function with a variable amount of parameters.

Parameters:
strFunctionName - name of the function without database prefix (e. g. PACKAGENAME.functionName)
oaParameters - Object-array containing all the parameters, can be null as well, which means no-parameter-at-all
strDBPrefix - database Prefix, not null
dDefaultValue - default value
Returns:
the jav.util.Date-result of the function if the function just returns ONE value
Throws:
SQLException - if an error occured
Since:
2006-03-22

software.glawar.at

Developed by software.glawar.at