Class DataAccess

java.lang.Object
com.jsql.model.accessible.DataAccess

public class DataAccess extends Object
Database resource object to read name of databases, tables, columns and values using most suited injection strategy.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Regex schema describing a table cell with firstly the cell content and secondly the number of occurrences of the cell text, separated by the reserved character x05 in hexadecimal.
    static final String
    Regex character enclosing a table cell returned by injection.
    static final String
     
    static final String
    Regex keywords corresponding to multiline and case-insensitive match.
    static final String
    Regex character used between each table cells.
    static final String
    Regex character used between the table cell and the number of occurrence of the cell text.
    static final String
     
    static final String
     
    static final String
     
    static final String
    Regex characters marking the end of the result of an injection.
  • Constructor Summary

    Constructors
    Constructor
    Description
    DataAccess(InjectionModel injectionModel)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Get general database informations.
    => version{%}database{%}user{%}CURRENT_USER
    Get column names and send them to the view.
    Use readable text (not hexa) and parse this pattern with 2nd member forced to 31 (1 in ascii):
    => hh[column name 1]jj[31]hhgghh[column name 2]jj[31]hhggh...hi
    Data window can be cut before the end of the request but the process helps to obtain the rest of the unreachable data.
    Get database names and table counts and send them to the view.
    Use readable text (not hexa) and parse this pattern:
    => hh[database name 1]jj[table count]hhgghh[database name 2]jj[table count]hhggh...hi
    Data window can be cut before the end of the request but the process helps to obtain the rest of the unreachable data.
    listTables(Database database)
    Get tables name and row count and send them to the view.
    Use readable text (not hexa) and parse this pattern:
    => hh[table name 1]jj[rows count]hhgghh[table name 2]jj[rows count]hhggh...hi
    Data window can be cut before the end of the request but the process helps to obtain the rest of the unreachable data.
    String[][]
    listValues(List<Column> columnsBean)
    Get table values and count each occurrences and send them to the view.
    Values are on clear text (not hexa) and follows this window pattern
    => hh[value 1]jj[count]hhgghh[value 2]jj[count]hhggh...hi
    Data window can be cut before the end of the request but the process helps to obtain the rest of the unreachable data.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • TRAIL_RGX

      public static final String TRAIL_RGX
      Regex characters marking the end of the result of an injection. Process stops when this schema is encountered:
      SQLix01x03x03x07
      See Also:
    • SEPARATOR_CELL_RGX

      public static final String SEPARATOR_CELL_RGX
      Regex character used between each table cells. Expected schema of multiple table cells :
       x04[table cell]x05[number of occurrences]x04x06x04[table cell]x05[number of occurrences]x04
      See Also:
    • SEPARATOR_QTE_RGX

      public static final String SEPARATOR_QTE_RGX
      Regex character used between the table cell and the number of occurrence of the cell text. Expected schema of a table cell data is
      x04[table cell]x05[number of occurrences]x04
      See Also:
    • ENCLOSE_VALUE_RGX

      public static final String ENCLOSE_VALUE_RGX
      Regex character enclosing a table cell returned by injection. It allows to detect the correct end of a table cell data during parsing. Expected schema of a table cell data is
      x04[table cell]x05[number of occurrences]x04
      See Also:
    • LEAD

      public static final String LEAD
      See Also:
    • SHELL_LEAD

      public static final String SHELL_LEAD
      See Also:
    • TRAIL

      public static final String TRAIL
      See Also:
    • SHELL_TRAIL

      public static final String SHELL_TRAIL
      See Also:
    • MODE

      public static final String MODE
      Regex keywords corresponding to multiline and case-insensitive match.
      See Also:
    • CELL_TABLE

      public static final String CELL_TABLE
      Regex schema describing a table cell with firstly the cell content and secondly the number of occurrences of the cell text, separated by the reserved character x05 in hexadecimal. The range of characters from x01 to x1F are not printable ASCII characters used to parse the data and exclude printable characters during parsing. Expected schema of a table cell data is
      x04[table cell]x05[number of occurrences]x04
      See Also:
  • Constructor Details

  • Method Details

    • getDatabaseInfos

      public void getDatabaseInfos()
      Get general database informations.
      => version{%}database{%}user{%}CURRENT_USER
    • listDatabases

      public List<Database> listDatabases() throws JSqlException
      Get database names and table counts and send them to the view.
      Use readable text (not hexa) and parse this pattern:
      => hh[database name 1]jj[table count]hhgghh[database name 2]jj[table count]hhggh...hi
      Data window can be cut before the end of the request but the process helps to obtain the rest of the unreachable data. The process can be interrupted by the user (stop/pause).
      Returns:
      list of databases found
      Throws:
      JSqlException - when injection failure or stopped by user
    • listTables

      public List<Table> listTables(Database database) throws JSqlException
      Get tables name and row count and send them to the view.
      Use readable text (not hexa) and parse this pattern:
      => hh[table name 1]jj[rows count]hhgghh[table name 2]jj[rows count]hhggh...hi
      Data window can be cut before the end of the request but the process helps to obtain the rest of the unreachable data. The process can be interrupted by the user (stop/pause).
      Parameters:
      database - which contains tables to find
      Returns:
      list of tables found
      Throws:
      JSqlException - when injection failure or stopped by user
    • listColumns

      public List<Column> listColumns(Table table) throws JSqlException
      Get column names and send them to the view.
      Use readable text (not hexa) and parse this pattern with 2nd member forced to 31 (1 in ascii):
      => hh[column name 1]jj[31]hhgghh[column name 2]jj[31]hhggh...hi
      Data window can be cut before the end of the request but the process helps to obtain the rest of the unreachable data. The process can be interrupted by the user (stop/pause).
      Parameters:
      table - which contains columns to find
      Returns:
      list of columns found
      Throws:
      JSqlException - when injection failure or stopped by user
    • listValues

      public String[][] listValues(List<Column> columnsBean) throws JSqlException
      Get table values and count each occurrences and send them to the view.
      Values are on clear text (not hexa) and follows this window pattern
      => hh[value 1]jj[count]hhgghh[value 2]jj[count]hhggh...hi
      Data window can be cut before the end of the request but the process helps to obtain the rest of the unreachable data. The process can be interrupted by the user (stop/pause).
      Parameters:
      columnsBean - choice by the user
      Returns:
      a 2x2 table containing values by columns
      Throws:
      JSqlException - when injection failure or stopped by user