Class CacheDelegate

    • Constructor Detail

      • CacheDelegate

        public CacheDelegate()
    • Method Detail

      • setBytes

        protected void setBytes​(java.sql.PreparedStatement ps,
                                int index,
                                java.io.ByteArrayOutputStream baos)
                         throws java.sql.SQLException
        Sets the designated parameter to the byte array of the given ByteArrayOutputStream. Will set parameter value to null if the ByteArrayOutputStream is null. This just wraps PreparedStatement.setBytes(int, byte[]) by default, but it can be overloaded by subclass delegates for databases that don't explicitly support storing bytes in this way.
        Overrides:
        setBytes in class StdJDBCDelegate
        Throws:
        java.sql.SQLException
      • getObjectFromBlob

        protected java.lang.Object getObjectFromBlob​(java.sql.ResultSet rs,
                                                     java.lang.String colName)
                                              throws java.lang.ClassNotFoundException,
                                                     java.io.IOException,
                                                     java.sql.SQLException

        This method should be overridden by any delegate subclasses that need special handling for BLOBs. The default implementation uses standard JDBC java.sql.Blob operations.

        Caché requires java.sql.Blob instances to be explicitly freed.

        Overrides:
        getObjectFromBlob in class StdJDBCDelegate
        Parameters:
        rs - the result set, already queued to the correct row
        colName - the column name for the BLOB
        Returns:
        the deserialized Object from the ResultSet BLOB
        Throws:
        java.lang.ClassNotFoundException - if a class found during deserialization cannot be found
        java.io.IOException - if deserialization causes an error
        java.sql.SQLException
      • getJobDataFromBlob

        protected java.lang.Object getJobDataFromBlob​(java.sql.ResultSet rs,
                                                      java.lang.String colName)
                                               throws java.lang.ClassNotFoundException,
                                                      java.io.IOException,
                                                      java.sql.SQLException

        This method should be overridden by any delegate subclasses that need special handling for BLOBs for job details. The default implementation uses standard JDBC java.sql.Blob operations.

        Caché requires java.sql.Blob instances to be explicitly freed.

        Overrides:
        getJobDataFromBlob in class StdJDBCDelegate
        Parameters:
        rs - the result set, already queued to the correct row
        colName - the column name for the BLOB
        Returns:
        the deserialized Object from the ResultSet BLOB
        Throws:
        java.lang.ClassNotFoundException - if a class found during deserialization cannot be found
        java.io.IOException - if deserialization causes an error
        java.sql.SQLException