org.brains2b.sql.oracle
Class OracleDataHelper

java.lang.Object
  |
  +--org.brains2b.sql.oracle.OracleDataHelper

public class OracleDataHelper
extends java.lang.Object

Class with static functions to help with Oracle datatypes

Oracle has no support for boolean types and those are usually implemented as VARCHAR2(1) containing either Y or N. two functions getYesNo(boolean) and getBoolean(String) are implemented to make that conversion

Version:
0.1 [20-01-2002]
Author:
dennis@brains2b.nl

Constructor Summary
OracleDataHelper()
           
 
Method Summary
static boolean getBoolean(java.lang.String yesNo)
          Function getBoolean, returns true if the String consist of the letter Y or y and return false in all other cases.
static java.lang.String getYesNo(boolean b)
          Function getYesNo returns the character 'Y' for boolean true and 'N' for boolean false
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OracleDataHelper

public OracleDataHelper()
Method Detail

getYesNo

public static java.lang.String getYesNo(boolean b)
Function getYesNo returns the character 'Y' for boolean true and 'N' for boolean false

Parameters:
b - boolean value,
Returns:
String of length one containing either 'Y' or 'N'

getBoolean

public static boolean getBoolean(java.lang.String yesNo)
Function getBoolean, returns true if the String consist of the letter Y or y and return false in all other cases. Whitespace is ignored in the evaluation.

Returns:
boolean, true if String consist of 'Y' or 'y' and false in all other cases
Throws:
java.lang.NullPointerException - if String is null