Package oracle.sql

Class BOOLEAN

All Implemented Interfaces:
Serializable

public class BOOLEAN extends Datum
The BOOLEAN class is a representation of the Oracle BOOLEAN datatype. It is intended to be immutable. The user should not try to change its contents once it is constructed.
See Also:
  • Constructor Details

    • BOOLEAN

      public BOOLEAN(byte[] _bytes)
      Construct a BOOLEAN from a byte array.
      Parameters:
      _bytes - input data from which this class instance is constructed.
    • BOOLEAN

      public BOOLEAN(boolean bool)
      Construct a BOOLEAN from a primitive boolean.
      Parameters:
      bool - input data from which this class instance is constructed.
    • BOOLEAN

      public BOOLEAN(Boolean bool)
      Construct a BOOLEAN from an instance of java.lang.Boolean.
      Parameters:
      bool - input data from which this class instance is constructed.
  • Method Details

    • isConvertibleTo

      public boolean isConvertibleTo(Class<?> cls)
      Determines if the object can be converted to a particular class
      Specified by:
      isConvertibleTo in class Datum
      Parameters:
      cls - Class to convert to
      Returns:
      true, if conversion to cls is permitted false, if conversion to cls is not permitted
    • toJdbc

      public Object toJdbc() throws SQLException
      Returns the JDBC representation of the datum object
      Specified by:
      toJdbc in class Datum
      Returns:
      an object containing the JDBC value
      Throws:
      SQLException - if conversion to JDBC representation results in an error
    • toBooleanValue

      public boolean toBooleanValue() throws SQLException
      Calls toBoolean to convert into a Java Boolean.
      Returns:
      a Java Boolean value
      Throws:
      SQLException
    • booleanValue

      public boolean booleanValue() throws SQLException
      Calls toBooleanValue() to convert into a Java Boolean.
      Overrides:
      booleanValue in class Datum
      Returns:
      Java boolean representation of this object
      Throws:
      SQLException
    • toBoolean

      public static boolean toBoolean(byte[] bytes)
      Convert an Oracle Number to a Java boolean. A zero value translates to false and non-zero values translate to true
      Parameters:
      bytes - in byte array format
      Returns:
      a Java boolean value
    • makeJdbcArray

      public Object makeJdbcArray(int arraySize)
      Returns a JDBC array representation of the datum
      Specified by:
      makeJdbcArray in class Datum
      Parameters:
      arraySize - size of the array
      Returns:
      an object containing the JDBC array value
      Throws:
      SQLException - if conversion to JDBC array representation results in an error