Package oracle.sql

Class 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
    • 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