Class PrepareResultPacket

  • All Implemented Interfaces:
    org.mariadb.jdbc.client.Completion, Prepare, org.mariadb.jdbc.message.ServerMessage
    Direct Known Subclasses:
    CachedPrepareResultPacket

    public class PrepareResultPacket
    extends Object
    implements org.mariadb.jdbc.client.Completion, Prepare
    Prepare result packet See https://mariadb.com/kb/en/com_stmt_prepare/#COM_STMT_PREPARE_OK
    • Field Detail

      • statementId

        protected int statementId
        prepare statement id
    • Constructor Detail

      • PrepareResultPacket

        public PrepareResultPacket​(org.mariadb.jdbc.client.ReadableByteBuf buffer,
                                   Reader reader,
                                   org.mariadb.jdbc.client.Context context)
                            throws IOException
        Prepare packet constructor (parsing)
        Parameters:
        buffer - packet buffer
        reader - packet reader
        context - connection context
        Throws:
        IOException - if socket exception occurs
    • Method Detail

      • close

        public void close​(org.mariadb.jdbc.client.Client con)
                   throws SQLException
        Close prepare packet
        Specified by:
        close in interface Prepare
        Parameters:
        con - current connection
        Throws:
        SQLException - if exception occurs
      • decrementUse

        public void decrementUse​(org.mariadb.jdbc.client.Client con,
                                 ServerPreparedStatement preparedStatement)
                          throws SQLException
        Decrement use of prepare packet, so closing it if last used
        Specified by:
        decrementUse in interface Prepare
        Parameters:
        con - connection
        preparedStatement - current prepared statement that was using prepare object
        Throws:
        SQLException - if exception occurs
      • getStatementId

        public int getStatementId()
        Get statement id
        Specified by:
        getStatementId in interface Prepare
        Returns:
        statement id
      • getParameters

        public org.mariadb.jdbc.client.Column[] getParameters()
        Description copied from interface: Prepare
        Prepare parameters
        Specified by:
        getParameters in interface Prepare
        Returns:
        parameters metadata
      • getColumns

        public org.mariadb.jdbc.client.Column[] getColumns()
        Description copied from interface: Prepare
        Prepare result-set columns
        Specified by:
        getColumns in interface Prepare
        Returns:
        result-set columns metadata
      • setColumns

        public void setColumns​(org.mariadb.jdbc.client.Column[] columns)
        Description copied from interface: Prepare
        set prepare result-set columns
        Specified by:
        setColumns in interface Prepare
        Parameters:
        columns - set result-set columns metadata