Skip to content

SQL Console

Georg Fischer edited this page Nov 1, 2019 · 4 revisions

Dbat's web application contains an SQL Console page in order to combine the simplicity of a direct SQL command with the flexibility of Dbat's output formats. The console page is linked on the more page. It has several input fields for

  • the target language,
  • the output encoding,
  • the desired output format (mode),
  • the database connection to be used,
  • a limit for the maximum number of rows to be returned by a query.
The lower part of the page has a big <tt><textarea></tt> field, where an SQL instruction (SELECT, INSERT, UPDATE, DELETE, and also DDL) can be entered. This SQL instruction is run against the selected database system, and the results are output in the desired format on a separate page.

Implementation

Though the general control flow is similiar to that in SpecificationHandler, there is currently no separate handler for direct SQL. The console page is entered in DbatServlet via parameter view=con, and the output is generated in DbatServlet with view=con2.

Since the SQL instruction in the <tt><textarea></tt> field may be lengthy (SQL with more than 100 lines is not unusual), the HTTP request is sent with method=post by the console page .

Test Cases

SC1, SC2

Clone this wiki locally