Package oracle.sql

## Class BOOLEAN

- java.lang.Object
- - oracle.sql.Datum
  - - oracle.sql.BOOLEAN

All Implemented Interfaces:
  `java.io.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:
  Serialized Form

### Field Summary

### Fields inherited from class oracle.sql.Datum

`ojiOracleDatumWithConnection, targetDatum`

### Constructor Summary

Constructors
`BOOLEAN​(boolean bool)` Construct a BOOLEAN from a primitive boolean.
`BOOLEAN​(byte[] _bytes)` Construct a BOOLEAN from a byte array.
`BOOLEAN​(java.lang.Boolean bool)` Construct a BOOLEAN from an instance of java.lang.Boolean.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`boolean` `isConvertibleTo​(java.lang.Class<?> cls)` Determines if the object can be converted to a particular class
`java.lang.Object` `makeJdbcArray​(int arraySize)` Returns a JDBC array representation of the datum
`static boolean` `toBoolean​(byte[] bytes)` Convert an Oracle Number to a Java boolean.
`boolean` `toBooleanValue()` Calls toBoolean to convert into a Java Boolean.
`java.lang.Object` `toJdbc()` Returns the JDBC representation of the datum object

### Methods inherited from class oracle.sql.Datum

`asciiStreamValue, bigDecimalValue, binaryStreamValue, booleanValue, bytesEqual, bytesHashCode, byteValue, characterStreamValue, compareBytes, dateValue, doubleValue, equals, floatValue, getBytes, getConnectionDuringExceptionHandling, getLength, getStream, intValue, isNull, longValue, setBytes, setShareBytes, shareBytes, stringValue, stringValue, timestampValue, timestampValue, timeValue, timeValue, toClass`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### 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​(java.lang.Boolean bool)

Construct a BOOLEAN from an instance of java.lang.Boolean.

Parameters:
  `bool` - input data from which this class instance is constructed.

### Method Detail

#### isConvertibleTo

    public boolean isConvertibleTo​(java.lang.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 java.lang.Object toJdbc()
                            throws java.sql.SQLException

Returns the JDBC representation of the datum object

Specified by:
  `toJdbc` in class `Datum`
Returns:
  an object containing the JDBC value
Throws:
  `java.sql.SQLException` - if conversion to JDBC representation results in an error

#### toBooleanValue

    public boolean toBooleanValue()
                           throws java.sql.SQLException

Calls toBoolean to convert into a Java Boolean.

Returns:
  a Java Boolean value
Throws:
  `java.sql.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 java.lang.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:
  `java.sql.SQLException` - if conversion to JDBC array representation results in an error