Class CompleteResult

    • Constructor Detail

      • CompleteResult

        public CompleteResult​(Statement stmt,
                              boolean binaryProtocol,
                              long maxRows,
                              ColumnDefinitionPacket[] metadataList,
                              PacketReader reader,
                              Context context,
                              int resultSetType,
                              boolean closeOnCompletion,
                              boolean traceEnable)
                       throws java.io.IOException,
                              java.sql.SQLException
        Throws:
        java.io.IOException
        java.sql.SQLException
    • Method Detail

      • createResultSet

        public static java.sql.ResultSet createResultSet​(java.lang.String columnName,
                                                         DataType columnType,
                                                         java.lang.String[][] data,
                                                         Context context)
      • createResultSet

        public static java.sql.ResultSet createResultSet​(java.lang.String[] columnNames,
                                                         DataType[] columnTypes,
                                                         java.lang.String[][] data,
                                                         Context context)
        Create a result set from given data. Useful for creating "fake" resultSets for DatabaseMetaData, (one example is MariaDbDatabaseMetaData.getTypeInfo())
        Parameters:
        columnNames - - string array of column names
        columnTypes - - column types
        data - - each element of this array represents a complete row in the ResultSet. Each value is given in its string representation, as in MariaDB text protocol, except boolean (BIT(1)) values that are represented as "1" or "0" strings
        context - connection context
        Returns:
        resultset
      • next

        public boolean next()
                     throws java.sql.SQLException
        Specified by:
        next in interface java.sql.ResultSet
        Specified by:
        next in class Result
        Throws:
        java.sql.SQLException
      • streaming

        public boolean streaming()
        Specified by:
        streaming in class Result
      • closeFromStmtClose

        public void closeFromStmtClose​(java.util.concurrent.locks.ReentrantLock lock)
        Overrides:
        closeFromStmtClose in class Result
      • isAfterLast

        public boolean isAfterLast()
                            throws java.sql.SQLException
        Specified by:
        isAfterLast in interface java.sql.ResultSet
        Specified by:
        isAfterLast in class Result
        Throws:
        java.sql.SQLException
      • isFirst

        public boolean isFirst()
                        throws java.sql.SQLException
        Specified by:
        isFirst in interface java.sql.ResultSet
        Specified by:
        isFirst in class Result
        Throws:
        java.sql.SQLException
      • isLast

        public boolean isLast()
                       throws java.sql.SQLException
        Specified by:
        isLast in interface java.sql.ResultSet
        Specified by:
        isLast in class Result
        Throws:
        java.sql.SQLException
      • beforeFirst

        public void beforeFirst()
                         throws java.sql.SQLException
        Specified by:
        beforeFirst in interface java.sql.ResultSet
        Specified by:
        beforeFirst in class Result
        Throws:
        java.sql.SQLException
      • afterLast

        public void afterLast()
                       throws java.sql.SQLException
        Specified by:
        afterLast in interface java.sql.ResultSet
        Specified by:
        afterLast in class Result
        Throws:
        java.sql.SQLException
      • first

        public boolean first()
                      throws java.sql.SQLException
        Specified by:
        first in interface java.sql.ResultSet
        Specified by:
        first in class Result
        Throws:
        java.sql.SQLException
      • last

        public boolean last()
                     throws java.sql.SQLException
        Specified by:
        last in interface java.sql.ResultSet
        Specified by:
        last in class Result
        Throws:
        java.sql.SQLException
      • getRow

        public int getRow()
                   throws java.sql.SQLException
        Specified by:
        getRow in interface java.sql.ResultSet
        Specified by:
        getRow in class Result
        Throws:
        java.sql.SQLException
      • absolute

        public boolean absolute​(int idx)
                         throws java.sql.SQLException
        Specified by:
        absolute in interface java.sql.ResultSet
        Specified by:
        absolute in class Result
        Throws:
        java.sql.SQLException
      • relative

        public boolean relative​(int rows)
                         throws java.sql.SQLException
        Specified by:
        relative in interface java.sql.ResultSet
        Specified by:
        relative in class Result
        Throws:
        java.sql.SQLException
      • previous

        public boolean previous()
                         throws java.sql.SQLException
        Specified by:
        previous in interface java.sql.ResultSet
        Specified by:
        previous in class Result
        Throws:
        java.sql.SQLException
      • getFetchSize

        public int getFetchSize()
                         throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • setFetchSize

        public void setFetchSize​(int rows)
                          throws java.sql.SQLException
        Throws:
        java.sql.SQLException