Class CachedPrepareResultPacket

  • All Implemented Interfaces:
    org.mariadb.jdbc.client.Completion, Prepare, org.mariadb.jdbc.message.ServerMessage

    public final class CachedPrepareResultPacket
    extends PrepareResultPacket
    Prepare packet result with flag indicating use
    • Constructor Detail

      • CachedPrepareResultPacket

        public CachedPrepareResultPacket​(org.mariadb.jdbc.client.ReadableByteBuf buffer,
                                         Reader reader,
                                         org.mariadb.jdbc.client.Context context)
                                  throws IOException
        Cache prepare result with flag indicating use
        Parameters:
        buffer - prepare packet buffer
        reader - packet reader
        context - connection context
        Throws:
        IOException - if any socket error occurs
    • Method Detail

      • close

        public void close​(org.mariadb.jdbc.client.Client con)
                   throws SQLException
        Indicate that a prepare statement must be closed (if not in LRU cache)
        Specified by:
        close in interface Prepare
        Overrides:
        close in class PrepareResultPacket
        Parameters:
        con - current connection
        Throws:
        SQLException - if SQL
      • incrementUse

        public void incrementUse​(ServerPreparedStatement preparedStatement)
        Increment use of prepare statement.
        Parameters:
        preparedStatement - new statement using prepare result
      • unCache

        public void unCache​(org.mariadb.jdbc.client.Client con)
        Indicate that Prepare command is not on LRU cache anymore. closing prepare command if not used
        Parameters:
        con - current connection
      • cache

        public boolean cache()
        indicate that result is in LRU cache
        Returns:
        true if cached
      • reset

        public void reset()
        Resetting cache in case of failover