Interface PGConnection

    • Method Detail

      • isServerMinimumVersion

        boolean isServerMinimumVersion​(int major,
                                       int minor)
        Checks the minimum server version
        Parameters:
        major - The major release
        minor - The minor release
        Returns:
        True if the server is minimum the specified version, otherwise false.
      • addNotificationListener

        void addNotificationListener​(String name,
                                     String channelNameFilter,
                                     PGNotificationListener listener)
        Adds a filtered asynchronous notification listener to this connection
        Parameters:
        name - Name of listener
        channelNameFilter - Channel name based notification filter (Regular Expression)
        listener - Notification listener
      • addNotificationListener

        void addNotificationListener​(String channelNameFilter,
                                     PGNotificationListener listener)
        Adds an, unnamed, filtered, asynchronous notification listener to this connection
        Parameters:
        channelNameFilter - Channel name based notification filter (Regular Expression)
        listener - Notification listener
      • addNotificationListener

        void addNotificationListener​(PGNotificationListener listener)
        Adds an, unnamed, unfiltered, asynchronous notification listener to this connection
        Parameters:
        listener - Notification listener
      • removeNotificationListener

        void removeNotificationListener​(String name)
        Removes a named notification listener
        Parameters:
        name - Name of listener to remove
      • removeNotificationListener

        void removeNotificationListener​(PGNotificationListener listener)
        Removes a notification listener
        Parameters:
        listener - Listener instance to remove
      • setStrictMode

        void setStrictMode​(boolean v)
        Set strict mode
        Parameters:
        v - The value
      • isStrictMode

        boolean isStrictMode()
        Is strict mode
        Returns:
        The value
      • setDefaultFetchSize

        void setDefaultFetchSize​(Integer v)
        Set the default fetch size
        Parameters:
        v - The value
      • getDefaultFetchSize

        Integer getDefaultFetchSize()
        Get the default fetch size
        Returns:
        The value
      • resolveType

        PGAnyType resolveType​(String name)
                       throws SQLException
        Resolves a name to an SQLType suitable for passing to any method that accepts one. As the method queries the server for the type information any type name acceptable to the server is allowed (i.e. qualified, unqualified, quoted, etc.) Using this method allows the resolution of a name to a type to be re-used; speeding up performance in cases where named types are used. NOTE: The possibility of DDL changing the name to type mapping means named types are always looked up when used. This ensures that the correct type is used always. When resolving a named type using this method it is only valid as long as no commands are issued that invalidate it (e.g. dropping and re-adding a type or extension).
        Parameters:
        name - Name of type to resolve (anything acceptable to the server)
        Returns:
        Type instance representing the current name to type mapping.
        Throws:
        SQLException
      • copyFrom

        void copyFrom​(String sql,
                      InputStream inputStream)
               throws SQLException
        Allows issuing PostgreSQL's COPY command providing an InputStream stream to read from, instead of relying on System.in.
        Parameters:
        sql - SQL text for a valid COPY ... FROM STDIN command.
        inputStream - InputStream containing data in COPY format.
        Throws:
        SQLException - If an error occurs during the copy operation or if an alternate command is provided.
      • copyTo

        void copyTo​(String sql,
                    OutputStream outputStream)
             throws SQLException
        Allows issuing PostgreSQL's COPY command providing an OutputStream stream to write to, instead of relying on System.out.
        Parameters:
        sql - SQL text for a valid COPY ... TO STDOUT command.
        outputStream - OutputStream to write data in COPY format.
        Throws:
        SQLException - If an error occurs during the copy operation or if an alternate command is provided.