Class QueryExecutorImpl

    • Field Detail

      • LOGGER

        private static final java.util.logging.Logger LOGGER
      • NO_FIELDS

        private static final Field[] NO_FIELDS
      • timeZone

        private java.util.TimeZone timeZone
        TimeZone of the current connection (TimeZone backend parameter).
      • applicationName

        private java.lang.String applicationName
        application_name connection property.
      • integerDateTimes

        private boolean integerDateTimes
        True if server uses integers for date and time fields. False if server uses double.
      • useBinaryReceiveForOids

        private final java.util.Set<java.lang.Integer> useBinaryReceiveForOids
        Bit set that has a bit set for each oid which should be received using binary format.
      • useBinarySendForOids

        private final java.util.Set<java.lang.Integer> useBinarySendForOids
        Bit set that has a bit set for each oid which should be sent using binary format.
      • sync

        private final SimpleQuery sync
        This is a fake query object so processResults can distinguish "ReadyForQuery" messages from Sync messages vs from simple execute (aka 'Q').
      • deallocateEpoch

        private short deallocateEpoch
      • lastSetSearchPathQuery

        private java.lang.String lastSetSearchPathQuery
        This caches the latest observed set search_path query so the reset of prepared statement cache can be skipped if using repeated calls for the same set search_path value.
      • transactionFailCause

        private java.sql.SQLException transactionFailCause
        The exception that caused the last transaction to fail.
      • commandCompleteParser

        private final CommandCompleteParser commandCompleteParser
        CommandComplete(B) messages are quite common, so we reuse instance to parse those
      • lockedFor

        private java.lang.Object lockedFor

        Supplement to synchronization of public methods on current QueryExecutor.

        Necessary for keeping the connection intact between calls to public methods sharing a state such as COPY subprotocol. waitOnLock() must be called at beginning of each connection access point.

        Public methods sharing that state must then be synchronized among themselves. Normal method synchronization typically suffices for that.

        See notes on related methods as well as currentCopy() below.

      • MAX_BUFFERED_RECV_BYTES

        private static final int MAX_BUFFERED_RECV_BYTES
        See Also:
        Constant Field Values
      • NODATA_QUERY_RESPONSE_SIZE_BYTES

        private static final int NODATA_QUERY_RESPONSE_SIZE_BYTES
        See Also:
        Constant Field Values
      • processingCopyResults

        java.util.concurrent.atomic.AtomicBoolean processingCopyResults
      • parsedQueryMap

        private final java.util.HashMap<java.lang.ref.PhantomReference<SimpleQuery>,​java.lang.String> parsedQueryMap
      • parsedQueryCleanupQueue

        private final java.lang.ref.ReferenceQueue<SimpleQuery> parsedQueryCleanupQueue
      • openPortalMap

        private final java.util.HashMap<java.lang.ref.PhantomReference<Portal>,​java.lang.String> openPortalMap
      • openPortalCleanupQueue

        private final java.lang.ref.ReferenceQueue<Portal> openPortalCleanupQueue
      • UNNAMED_PORTAL

        private static final Portal UNNAMED_PORTAL
      • pendingParseQueue

        private final java.util.Deque<SimpleQuery> pendingParseQueue
      • pendingBindQueue

        private final java.util.Deque<Portal> pendingBindQueue
      • pendingExecuteQueue

        private final java.util.Deque<ExecuteRequest> pendingExecuteQueue
      • pendingDescribeStatementQueue

        private final java.util.Deque<DescribeRequest> pendingDescribeStatementQueue
      • pendingDescribePortalQueue

        private final java.util.Deque<SimpleQuery> pendingDescribePortalQueue
      • nextUniqueID

        private long nextUniqueID
      • allowEncodingChanges

        private final boolean allowEncodingChanges
      • cleanupSavePoints

        private final boolean cleanupSavePoints
      • estimatedReceiveBufferBytes

        private int estimatedReceiveBufferBytes

        The estimated server response size since we last consumed the input stream from the server, in bytes.

        Starts at zero, reset by every Sync message. Mainly used for batches.

        Used to avoid deadlocks, see MAX_BUFFERED_RECV_BYTES.

      • beginTransactionQuery

        private final SimpleQuery beginTransactionQuery
      • beginReadOnlyTransactionQuery

        private final SimpleQuery beginReadOnlyTransactionQuery
      • autoSaveQuery

        private final SimpleQuery autoSaveQuery
      • releaseAutoSave

        private final SimpleQuery releaseAutoSave
      • restoreToAutoSave

        private final SimpleQuery restoreToAutoSave
    • Constructor Detail

      • QueryExecutorImpl

        public QueryExecutorImpl​(PGStream pgStream,
                                 int cancelSignalTimeout,
                                 java.util.Properties info)
                          throws java.sql.SQLException,
                                 java.io.IOException
        Throws:
        java.sql.SQLException
        java.io.IOException
    • Method Detail

      • getProtocolVersion

        public int getProtocolVersion()
        Returns:
        the version of the implementation
      • lock

        private void lock​(java.lang.Object obtainer)
                   throws PSQLException
        Obtain lock over this connection for given object, blocking to wait if necessary.
        Parameters:
        obtainer - object that gets the lock. Normally current thread.
        Throws:
        PSQLException - when already holding the lock or getting interrupted.
      • unlock

        private void unlock​(java.lang.Object holder)
                     throws PSQLException
        Release lock on this connection presumably held by given object.
        Parameters:
        holder - object that holds the lock. Normally current thread.
        Throws:
        PSQLException - when this thread does not hold the lock
      • waitOnLock

        private void waitOnLock()
                         throws PSQLException
        Wait until our lock is released. Execution of a single synchronized method can then continue without further ado. Must be called at beginning of each synchronized public method.
        Throws:
        PSQLException
      • hasLockOn

        boolean hasLockOn​(java.lang.Object holder)
        Parameters:
        holder - object assumed to hold the lock
        Returns:
        whether given object actually holds the lock
      • hasLock

        private boolean hasLock​(java.lang.Object holder)
        Parameters:
        holder - object assumed to hold the lock
        Returns:
        whether given object actually holds the lock
      • createSimpleQuery

        public Query createSimpleQuery​(java.lang.String sql)
                                throws java.sql.SQLException
        Description copied from interface: QueryExecutor
        Create an unparameterized Query object suitable for execution by this QueryExecutor. The provided query string is not parsed for parameter placeholders ('?' characters), and the Query.createParameterList() of the returned object will always return an empty ParameterList.
        Parameters:
        sql - the SQL for the query to create
        Returns:
        a new Query object
        Throws:
        java.sql.SQLException - if something goes wrong
      • wrap

        public Query wrap​(java.util.List<NativeQuery> queries)
        Description copied from interface: QueryExecutor
        Wrap given native query into a ready for execution format.
        Parameters:
        queries - list of queries in native to database syntax
        Returns:
        query object ready for execution by this query executor
      • updateQueryMode

        private int updateQueryMode​(int flags)
      • execute

        public void execute​(Query query,
                            ParameterList parameters,
                            ResultHandler handler,
                            int maxRows,
                            int fetchSize,
                            int flags)
                     throws java.sql.SQLException
        Description copied from interface: QueryExecutor
        Execute a Query, passing results to a provided ResultHandler.
        Parameters:
        query - the query to execute; must be a query returned from calling QueryExecutor.wrap(List) on this QueryExecutor object.
        parameters - the parameters for the query. Must be non-null if the query takes parameters. Must be a parameter object returned by Query.createParameterList().
        handler - a ResultHandler responsible for handling results generated by this query
        maxRows - the maximum number of rows to retrieve
        fetchSize - if QUERY_FORWARD_CURSOR is set, the preferred number of rows to retrieve before suspending
        flags - a combination of QUERY_* flags indicating how to handle the query.
        Throws:
        java.sql.SQLException - if query execution fails
      • execute

        public void execute​(Query query,
                            ParameterList parameters,
                            ResultHandler handler,
                            int maxRows,
                            int fetchSize,
                            int flags,
                            boolean adaptiveFetch)
                     throws java.sql.SQLException
        Description copied from interface: QueryExecutor
        Execute a Query with adaptive fetch, passing results to a provided ResultHandler.
        Parameters:
        query - the query to execute; must be a query returned from calling QueryExecutor.wrap(List) on this QueryExecutor object.
        parameters - the parameters for the query. Must be non-null if the query takes parameters. Must be a parameter object returned by Query.createParameterList().
        handler - a ResultHandler responsible for handling results generated by this query
        maxRows - the maximum number of rows to retrieve
        fetchSize - if QUERY_FORWARD_CURSOR is set, the preferred number of rows to retrieve before suspending
        flags - a combination of QUERY_* flags indicating how to handle the query.
        adaptiveFetch - state of adaptiveFetch to use during execution
        Throws:
        java.sql.SQLException - if query execution fails
      • sendAutomaticSavepoint

        private boolean sendAutomaticSavepoint​(Query query,
                                               int flags)
                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • releaseSavePoint

        private void releaseSavePoint​(boolean autosave,
                                      int flags)
                               throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • rollbackIfRequired

        private void rollbackIfRequired​(boolean autosave,
                                        java.sql.SQLException e)
                                 throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • execute

        public void execute​(Query[] queries,
                            ParameterList[] parameterLists,
                            BatchResultHandler batchHandler,
                            int maxRows,
                            int fetchSize,
                            int flags)
                     throws java.sql.SQLException
        Description copied from interface: QueryExecutor
        Execute several Query, passing results to a provided ResultHandler.
        Parameters:
        queries - the queries to execute; each must be a query returned from calling QueryExecutor.wrap(List) on this QueryExecutor object.
        parameterLists - the parameter lists for the queries. The parameter lists correspond 1:1 to the queries passed in the queries array. Each must be non- null if the corresponding query takes parameters, and must be a parameter object returned by Query.createParameterList() created by the corresponding query.
        batchHandler - a ResultHandler responsible for handling results generated by this query
        maxRows - the maximum number of rows to retrieve
        fetchSize - if QUERY_FORWARD_CURSOR is set, the preferred number of rows to retrieve before suspending
        flags - a combination of QUERY_* flags indicating how to handle the query.
        Throws:
        java.sql.SQLException - if query execution fails
      • execute

        public void execute​(Query[] queries,
                            ParameterList[] parameterLists,
                            BatchResultHandler batchHandler,
                            int maxRows,
                            int fetchSize,
                            int flags,
                            boolean adaptiveFetch)
                     throws java.sql.SQLException
        Description copied from interface: QueryExecutor
        Execute several Query with adaptive fetch, passing results to a provided ResultHandler.
        Parameters:
        queries - the queries to execute; each must be a query returned from calling QueryExecutor.wrap(List) on this QueryExecutor object.
        parameterLists - the parameter lists for the queries. The parameter lists correspond 1:1 to the queries passed in the queries array. Each must be non- null if the corresponding query takes parameters, and must be a parameter object returned by Query.createParameterList() created by the corresponding query.
        batchHandler - a ResultHandler responsible for handling results generated by this query
        maxRows - the maximum number of rows to retrieve
        fetchSize - if QUERY_FORWARD_CURSOR is set, the preferred number of rows to retrieve before suspending
        flags - a combination of QUERY_* flags indicating how to handle the query.
        adaptiveFetch - state of adaptiveFetch to use during execution
        Throws:
        java.sql.SQLException - if query execution fails
      • sendQueryPreamble

        private ResultHandler sendQueryPreamble​(ResultHandler delegateHandler,
                                                int flags)
                                         throws java.io.IOException
        Throws:
        java.io.IOException
      • fastpathCall

        public byte[] fastpathCall​(int fnid,
                                   ParameterList parameters,
                                   boolean suppressBegin)
                            throws java.sql.SQLException
        Description copied from interface: QueryExecutor
        Invoke a backend function via the fastpath interface.
        Parameters:
        fnid - the OID of the backend function to invoke
        parameters - a ParameterList returned from QueryExecutor.createFastpathParameters(int) containing the parameters to pass to the backend function
        suppressBegin - if begin should be suppressed
        Returns:
        the binary-format result of the fastpath call, or null if a void result was returned
        Throws:
        java.sql.SQLException - if an error occurs while executing the fastpath call
      • doSubprotocolBegin

        public void doSubprotocolBegin()
                                throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • sendFastpathCall

        private void sendFastpathCall​(int fnid,
                                      SimpleParameterList params)
                               throws java.sql.SQLException,
                                      java.io.IOException
        Throws:
        java.sql.SQLException
        java.io.IOException
      • processNotifies

        public void processNotifies()
                             throws java.sql.SQLException
        Description copied from interface: QueryExecutor
        Prior to attempting to retrieve notifications, we need to pull any recently received notifications off of the network buffers. The notification retrieval in ProtocolConnection cannot do this as it is prone to deadlock, so the higher level caller must be responsible which requires exposing this method.
        Throws:
        java.sql.SQLException - if and error occurs while fetching notifications
      • processNotifies

        public void processNotifies​(int timeoutMillis)
                             throws java.sql.SQLException
        Description copied from interface: QueryExecutor
        Prior to attempting to retrieve notifications, we need to pull any recently received notifications off of the network buffers. The notification retrieval in ProtocolConnection cannot do this as it is prone to deadlock, so the higher level caller must be responsible which requires exposing this method. This variant supports blocking for the given time in millis.
        Parameters:
        timeoutMillis - when > 0, block for this time when =0, block forever when < 0, don't block
        Throws:
        java.sql.SQLException - if and error occurs while fetching notifications
      • receiveFastpathResult

        private byte[] receiveFastpathResult()
                                      throws java.io.IOException,
                                             java.sql.SQLException
        Throws:
        java.io.IOException
        java.sql.SQLException
      • startCopy

        public CopyOperation startCopy​(java.lang.String sql,
                                       boolean suppressBegin)
                                throws java.sql.SQLException
        Sends given query to BE to start, initialize and lock connection for a CopyOperation.
        Parameters:
        sql - COPY FROM STDIN / COPY TO STDOUT statement
        suppressBegin - if begin should be suppressed
        Returns:
        CopyIn or CopyOut operation object
        Throws:
        java.sql.SQLException - on failure
      • initCopy

        private void initCopy​(CopyOperationImpl op)
                       throws java.sql.SQLException,
                              java.io.IOException
        Locks connection and calls initializer for a new CopyOperation Called via startCopy -> processCopyResults.
        Parameters:
        op - an uninitialized CopyOperation
        Throws:
        java.sql.SQLException - on locking failure
        java.io.IOException - on database connection failure
      • cancelCopy

        public void cancelCopy​(CopyOperationImpl op)
                        throws java.sql.SQLException
        Finishes a copy operation and unlocks connection discarding any exchanged data.
        Parameters:
        op - the copy operation presumably currently holding lock on this connection
        Throws:
        java.sql.SQLException - on any additional failure
      • endCopy

        public long endCopy​(CopyOperationImpl op)
                     throws java.sql.SQLException
        Finishes writing to copy and unlocks connection.
        Parameters:
        op - the copy operation presumably currently holding lock on this connection
        Returns:
        number of rows updated for server versions 8.2 or newer
        Throws:
        java.sql.SQLException - on failure
      • writeToCopy

        public void writeToCopy​(CopyOperationImpl op,
                                byte[] data,
                                int off,
                                int siz)
                         throws java.sql.SQLException
        Sends data during a live COPY IN operation. Only unlocks the connection if server suddenly returns CommandComplete, which should not happen
        Parameters:
        op - the CopyIn operation presumably currently holding lock on this connection
        data - bytes to send
        off - index of first byte to send (usually 0)
        siz - number of bytes to send (usually data.length)
        Throws:
        java.sql.SQLException - on failure
      • writeToCopy

        public void writeToCopy​(CopyOperationImpl op,
                                ByteStreamWriter from)
                         throws java.sql.SQLException
        Sends data during a live COPY IN operation. Only unlocks the connection if server suddenly returns CommandComplete, which should not happen
        Parameters:
        op - the CopyIn operation presumably currently holding lock on this connection
        from - the source of bytes, e.g. a ByteBufferByteStreamWriter
        Throws:
        java.sql.SQLException - on failure
      • flushCopy

        public void flushCopy​(CopyOperationImpl op)
                       throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • readFromCopy

        void readFromCopy​(CopyOperationImpl op,
                          boolean block)
                   throws java.sql.SQLException
        Wait for a row of data to be received from server on an active copy operation Connection gets unlocked by processCopyResults() at end of operation.
        Parameters:
        op - the copy operation presumably currently holding lock on this connection
        block - whether to block waiting for input
        Throws:
        java.sql.SQLException - on any failure
      • processCopyResults

        CopyOperationImpl processCopyResults​(CopyOperationImpl op,
                                             boolean block)
                                      throws java.sql.SQLException,
                                             java.io.IOException
        Handles copy sub protocol responses from server. Unlocks at end of sub protocol, so operations on pgStream or QueryExecutor are not allowed in a method after calling this!
        Parameters:
        block - whether to block waiting for input
        Returns:
        CopyIn when COPY FROM STDIN starts; CopyOut when COPY TO STDOUT starts; null when copy ends; otherwise, the operation given as parameter.
        Throws:
        java.sql.SQLException - in case of misuse
        java.io.IOException - from the underlying connection
      • flushIfDeadlockRisk

        private void flushIfDeadlockRisk​(Query query,
                                         boolean disallowBatching,
                                         ResultHandler resultHandler,
                                         BatchResultHandler batchHandler,
                                         int flags)
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • sendQuery

        private void sendQuery​(Query query,
                               V3ParameterList parameters,
                               int maxRows,
                               int fetchSize,
                               int flags,
                               ResultHandler resultHandler,
                               BatchResultHandler batchHandler,
                               boolean adaptiveFetch)
                        throws java.io.IOException,
                               java.sql.SQLException
        Throws:
        java.io.IOException
        java.sql.SQLException
      • sendSync

        private void sendSync()
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • sendParse

        private void sendParse​(SimpleQuery query,
                               SimpleParameterList params,
                               boolean oneShot)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • sendBind

        private void sendBind​(SimpleQuery query,
                              SimpleParameterList params,
                              Portal portal,
                              boolean noBinaryTransfer)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • useBinary

        private boolean useBinary​(Field field)
        Returns true if the specified field should be retrieved using binary encoding.
        Parameters:
        field - The field whose Oid type to analyse.
        Returns:
        True if Field.BINARY_FORMAT should be used, false if Field.BINARY_FORMAT.
      • sendDescribePortal

        private void sendDescribePortal​(SimpleQuery query,
                                        Portal portal)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • sendDescribeStatement

        private void sendDescribeStatement​(SimpleQuery query,
                                           SimpleParameterList params,
                                           boolean describeOnly)
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • sendExecute

        private void sendExecute​(SimpleQuery query,
                                 Portal portal,
                                 int limit)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • sendClosePortal

        private void sendClosePortal​(java.lang.String portalName)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • sendCloseStatement

        private void sendCloseStatement​(java.lang.String statementName)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • sendOneQuery

        private void sendOneQuery​(SimpleQuery query,
                                  SimpleParameterList params,
                                  int maxRows,
                                  int fetchSize,
                                  int flags)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • sendSimpleQuery

        private void sendSimpleQuery​(SimpleQuery query,
                                     SimpleParameterList params)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • registerParsedQuery

        private void registerParsedQuery​(SimpleQuery query,
                                         java.lang.String statementName)
      • processDeadParsedQueries

        private void processDeadParsedQueries()
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • registerOpenPortal

        private void registerOpenPortal​(Portal portal)
      • processDeadPortals

        private void processDeadPortals()
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • processResults

        protected void processResults​(ResultHandler handler,
                                      int flags)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • processResults

        protected void processResults​(ResultHandler handler,
                                      int flags,
                                      boolean adaptiveFetch)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • skipMessage

        private void skipMessage()
                          throws java.io.IOException
        Ignore the response message by reading the message length and skipping over those bytes in the communication stream.
        Throws:
        java.io.IOException
      • fetch

        public void fetch​(ResultCursor cursor,
                          ResultHandler handler,
                          int fetchSize,
                          boolean adaptiveFetch)
                   throws java.sql.SQLException
        Description copied from interface: QueryExecutor
        Fetch additional rows from a cursor.
        Parameters:
        cursor - the cursor to fetch from
        handler - the handler to feed results to
        fetchSize - the preferred number of rows to retrieve before suspending
        adaptiveFetch - state of adaptiveFetch to use during fetching
        Throws:
        java.sql.SQLException - if query execution fails
      • getAdaptiveFetchSize

        public int getAdaptiveFetchSize​(boolean adaptiveFetch,
                                        ResultCursor cursor)
        Description copied from interface: QueryExecutor
        Get fetch size computed by adaptive fetch size for given query.
        Parameters:
        adaptiveFetch - state of adaptive fetch, which should be used during retrieving
        cursor - Cursor used by resultSet, containing query, have to be able to cast to Portal class.
        Returns:
        fetch size computed by adaptive fetch size for given query passed inside cursor
      • setAdaptiveFetch

        public void setAdaptiveFetch​(boolean adaptiveFetch)
        Description copied from interface: QueryExecutor
        Set state of adaptive fetch inside QueryExecutor.
        Parameters:
        adaptiveFetch - desired state of adaptive fetch
      • getAdaptiveFetch

        public boolean getAdaptiveFetch()
        Description copied from interface: QueryExecutor
        Get state of adaptive fetch inside QueryExecutor.
        Returns:
        state of adaptive fetch inside QueryExecutor
      • addQueryToAdaptiveFetchCache

        public void addQueryToAdaptiveFetchCache​(boolean adaptiveFetch,
                                                 ResultCursor cursor)
        Description copied from interface: QueryExecutor
        Add query to adaptive fetch cache inside QueryExecutor.
        Parameters:
        adaptiveFetch - state of adaptive fetch used during adding query
        cursor - Cursor used by resultSet, containing query, have to be able to cast to Portal class.
      • removeQueryFromAdaptiveFetchCache

        public void removeQueryFromAdaptiveFetchCache​(boolean adaptiveFetch,
                                                      ResultCursor cursor)
        Description copied from interface: QueryExecutor
        Remove query from adaptive fetch cache inside QueryExecutor
        Parameters:
        adaptiveFetch - state of adaptive fetch used during removing query
        cursor - Cursor used by resultSet, containing query, have to be able to cast to Portal class.
      • receiveFields

        private Field[] receiveFields()
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • receiveAsyncNotify

        private void receiveAsyncNotify()
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • receiveErrorResponse

        private java.sql.SQLException receiveErrorResponse()
                                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • receiveNoticeResponse

        private java.sql.SQLWarning receiveNoticeResponse()
                                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • receiveCommandStatus

        private java.lang.String receiveCommandStatus()
                                               throws java.io.IOException
        Throws:
        java.io.IOException
      • interpretCommandStatus

        private void interpretCommandStatus​(java.lang.String status,
                                            ResultHandler handler)
      • receiveRFQ

        private void receiveRFQ()
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • sendCloseMessage

        protected void sendCloseMessage()
                                 throws java.io.IOException
        Description copied from class: QueryExecutorBase
        Sends "terminate connection" message to the backend.
        Specified by:
        sendCloseMessage in class QueryExecutorBase
        Throws:
        java.io.IOException - in case connection termination fails
      • readStartupMessages

        public void readStartupMessages()
                                 throws java.io.IOException,
                                        java.sql.SQLException
        Throws:
        java.io.IOException
        java.sql.SQLException
      • receiveParameterStatus

        public void receiveParameterStatus()
                                    throws java.io.IOException,
                                           java.sql.SQLException
        Throws:
        java.io.IOException
        java.sql.SQLException
      • setTimeZone

        public void setTimeZone​(java.util.TimeZone timeZone)
      • getTimeZone

        public java.util.TimeZone getTimeZone()
        Description copied from interface: QueryExecutor
        Returns backend timezone in java format.
        Returns:
        backend timezone in java format.
      • setApplicationName

        public void setApplicationName​(java.lang.String applicationName)
      • getApplicationName

        public java.lang.String getApplicationName()
        Description copied from interface: QueryExecutor
        Returns application_name connection property.
        Returns:
        application_name connection property
      • getReplicationProtocol

        public ReplicationProtocol getReplicationProtocol()
        Returns:
        the ReplicationProtocol instance for this connection.
      • addBinaryReceiveOid

        public void addBinaryReceiveOid​(int oid)
        Description copied from interface: QueryExecutor
        Adds a single oid that should be received using binary encoding.
        Parameters:
        oid - The oid to request with binary encoding.
      • removeBinaryReceiveOid

        public void removeBinaryReceiveOid​(int oid)
        Description copied from interface: QueryExecutor
        Remove given oid from the list of oids for binary receive encoding.

        Note: the binary receive for the oid can be re-activated later.

        Parameters:
        oid - The oid to request with binary encoding.
      • getBinaryReceiveOids

        public java.util.Set<? extends java.lang.Integer> getBinaryReceiveOids()
        Description copied from interface: QueryExecutor
        Gets the oids that should be received using binary encoding.

        Note: this returns an unmodifiable set, and its contents might not reflect the current state.

        Returns:
        The oids to request with binary encoding.
      • useBinaryForReceive

        public boolean useBinaryForReceive​(int oid)
        Description copied from interface: TypeTransferModeRegistry
        Returns if given oid should be received in binary format.
        Parameters:
        oid - type oid
        Returns:
        true if given oid should be received in binary format
      • setBinaryReceiveOids

        public void setBinaryReceiveOids​(java.util.Set<java.lang.Integer> oids)
        Description copied from interface: QueryExecutor
        Sets the oids that should be received using binary encoding.
        Parameters:
        oids - The oids to request with binary encoding.
      • addBinarySendOid

        public void addBinarySendOid​(int oid)
        Description copied from interface: QueryExecutor
        Adds a single oid that should be sent using binary encoding.
        Parameters:
        oid - The oid to send with binary encoding.
      • removeBinarySendOid

        public void removeBinarySendOid​(int oid)
        Description copied from interface: QueryExecutor
        Remove given oid from the list of oids for binary send encoding.

        Note: the binary send for the oid can be re-activated later.

        Parameters:
        oid - The oid to send with binary encoding.
      • getBinarySendOids

        public java.util.Set<? extends java.lang.Integer> getBinarySendOids()
        Description copied from interface: QueryExecutor
        Gets the oids that should be sent using binary encoding.

        Note: this returns an unmodifiable set, and its contents might not reflect the current state.

        Returns:
        useBinaryForOids The oids to send with binary encoding.
      • useBinaryForSend

        public boolean useBinaryForSend​(int oid)
        Description copied from interface: TypeTransferModeRegistry
        Returns if given oid should be sent in binary format.
        Parameters:
        oid - type oid
        Returns:
        true if given oid should be sent in binary format
      • setBinarySendOids

        public void setBinarySendOids​(java.util.Set<java.lang.Integer> oids)
        Description copied from interface: QueryExecutor
        Sets the oids that should be sent using binary encoding.
        Parameters:
        oids - The oids to send with binary encoding.
      • setIntegerDateTimes

        private void setIntegerDateTimes​(boolean state)
      • getIntegerDateTimes

        public boolean getIntegerDateTimes()
        Description copied from interface: QueryExecutor
        Returns true if server uses integer instead of double for binary date and time encodings.
        Returns:
        the server integer_datetime setting.