Results Table Component
Query results are displayed in thetblResultados JTable component:
The results table uses a clean design with no grid lines and fills the entire viewport height for optimal viewing.
SELECT Query Results
When you execute a SELECT query, results are displayed as a data grid with columns and rows:Result Set Processing
Example SELECT Result
Query: SELECT * FROM employees LIMIT 5
Query: SELECT * FROM employees LIMIT 5
The results table would display:
Each column header shows the field name, and rows contain the corresponding data values.
| id | name | department | salary | hire_date |
|---|---|---|---|---|
| 1 | John Smith | IT | 75000.00 | 2020-01-15 |
| 2 | Jane Doe | HR | 65000.00 | 2019-03-22 |
| 3 | Bob Johnson | IT | 80000.00 | 2018-07-10 |
| 4 | Alice Williams | Sales | 70000.00 | 2021-05-18 |
| 5 | Charlie Brown | Marketing | 68000.00 | 2020-11-30 |
Data Modification Query Results
For INSERT, UPDATE, DELETE, and other modification queries, the results display differs:Affected Rows Display
Table Name Identified
If the affected table can be identified, the application displays the updated table contents automatically.
System Message
If the table cannot be identified, a system message shows the number of affected rows.
Auto-Refresh After Modifications
When a table name is successfully extracted, the results show the updated table:After executing an INSERT, UPDATE, or DELETE query, you’ll see the updated table contents, allowing you to verify your changes immediately.
Example Modification Results
INSERT Result
INSERT Result
Query:
INSERT INTO employees (name, department, salary) VALUES ('New Employee', 'IT', 85000);Result: The employees table is displayed with the new row included, showing all current records.UPDATE Result
UPDATE Result
Query:
UPDATE employees SET salary = 90000 WHERE id = 3;Result: The employees table is refreshed, showing the updated salary for employee ID 3.DELETE Result
DELETE Result
Query:
DELETE FROM employees WHERE id = 5;Result: The employees table is displayed without the deleted row.DDL Statement Result
DDL Statement Result
Query: For DDL statements or operations where the table name can’t be extracted, a simple message displays the affected row count.
TRUNCATE TABLE log_entries;Result:System Messages
The system message label (lblMensajeSistema) displays execution status:
Success Messages
Error Messages
Error: Table 'database.nonexistent' doesn't existError: Duplicate entry '123' for key 'PRIMARY'Error: Unknown column 'invalid_field' in 'field list'
Table Browser Functionality
The table browser list (listaTablas) on the right side provides quick access to database tables:
Table List Display
Double-Click Query Generation
Double-clicking a table name generates an automatic SELECT query:Data Type Handling
The results table handles various MySQL data types:- Numeric: INT, BIGINT, DECIMAL, FLOAT, DOUBLE
- String: VARCHAR, CHAR, TEXT, ENUM
- Date/Time: DATE, DATETIME, TIMESTAMP, TIME
- Binary: BLOB, BINARY
- Boolean: BOOLEAN, TINYINT(1)
- NULL values: Displayed as
null
Empty Result Sets
No Rows Returned
No Rows Returned
When a SELECT query returns no rows:
- Column headers are still displayed
- The table area shows empty rows
- The system message confirms “Consulta ejecutada correctamente”
SELECT * FROM employees WHERE department = 'NonExistent' would show column headers but no data rows.Zero Rows Affected
Zero Rows Affected
When an UPDATE or DELETE affects no rows:This indicates the query executed successfully but matched no records.
Results Table Scrolling
The results table is wrapped in a scroll pane for handling large result sets:Large result sets can be scrolled both horizontally (for many columns) and vertically (for many rows). The table automatically adds scrollbars when needed.
Clearing Results
The Limpiar (Clear) button resets the results display:- Query text from the editor
- All rows and columns from the results table
- The system message
Best Practices
Use LIMIT for Large Tables
Prevent overwhelming results by limiting row counts:
Verify Modifications
After INSERT/UPDATE/DELETE, review the refreshed table to confirm changes.
Check System Messages
Always read the system message to ensure queries executed as expected.
Use Table Browser
Double-click tables in the browser for quick data exploration.
Next Steps
Writing Queries
Learn advanced query techniques and syntax
Managing Connections
Switch databases and manage active connections