类 CommentClientInfoProvider

  • 所有已实现的接口:
    ClientInfoProvider

    public class CommentClientInfoProvider
    extends Object
    implements ClientInfoProvider
    An implementation of ClientInfoProvider that exposes the client info as a comment prepended to all statements issued by the driver. Client information is never read from the server with this implementation, it is always cached locally.
    • 构造器详细资料

      • CommentClientInfoProvider

        public CommentClientInfoProvider()
    • 方法详细资料

      • initialize

        public void initialize​(Connection conn,
                               Properties configurationProps)
                        throws SQLException
        从接口复制的说明: ClientInfoProvider
        Called once by the driver when it needs to configure the provider.
        指定者:
        initialize 在接口中 ClientInfoProvider
        参数:
        conn - the connection that the provider belongs too.
        configurationProps - a java.util.Properties instance that contains configuration information for the connection.
        抛出:
        SQLException - if initialization fails.
      • destroy

        public void destroy()
                     throws SQLException
        从接口复制的说明: ClientInfoProvider
        Called once by the driver when the connection this provider instance belongs to is being closed. Implementations are expected to clean up and resources at this point in time.
        指定者:
        destroy 在接口中 ClientInfoProvider
        抛出:
        SQLException - if an error occurs.
      • getClientInfo

        public Properties getClientInfo​(Connection conn)
                                 throws SQLException
        从接口复制的说明: ClientInfoProvider
        Returns the client info for the connection that this provider instance belongs to. The connection instance is passed as an argument for convenience's sake. Providers can use the connection to communicate with the database, but it will be within the scope of any ongoing transactions, so therefore implementations should not attempt to change isolation level, autocommit settings or call rollback() or commit() on the connection.
        指定者:
        getClientInfo 在接口中 ClientInfoProvider
        参数:
        conn - connection object
        返回:
        client info as Properties
        抛出:
        SQLException - if an error occurs
        另请参阅:
        Connection.getClientInfo()
      • getClientInfo

        public String getClientInfo​(Connection conn,
                                    String name)
                             throws SQLException
        从接口复制的说明: ClientInfoProvider
        Returns the client info for the connection that this provider instance belongs to. The connection instance is passed as an argument for convenience's sake. Providers can use the connection to communicate with the database, but it will be within the scope of any ongoing transactions, so therefore implementations should not attempt to change isolation level, autocommit settings or call rollback() or commit() on the connection.
        指定者:
        getClientInfo 在接口中 ClientInfoProvider
        参数:
        conn - connection object
        name - property name
        返回:
        the client info by given property name
        抛出:
        SQLException - if an error occurs
        另请参阅:
        Connection.getClientInfo(java.lang.String)
      • setClientInfo

        public void setClientInfo​(Connection conn,
                                  Properties properties)
                           throws SQLClientInfoException
        从接口复制的说明: ClientInfoProvider
        Sets the client info for the connection that this provider instance belongs to. The connection instance is passed as an argument for convenience's sake. Providers can use the connection to communicate with the database, but it will be within the scope of any ongoing transactions, so therefore implementations should not attempt to change isolation level, autocommit settings or call rollback() or commit() on the connection.
        指定者:
        setClientInfo 在接口中 ClientInfoProvider
        参数:
        conn - connection object
        properties - Properties object
        抛出:
        SQLClientInfoException - if an error occurs
        另请参阅:
        Connection.setClientInfo(java.util.Properties)