diff --git a/app/src/main/java/sqlite/viewer/Driver.java b/app/src/main/java/sqlite/viewer/Driver.java index d2ea303..48056fe 100644 --- a/app/src/main/java/sqlite/viewer/Driver.java +++ b/app/src/main/java/sqlite/viewer/Driver.java @@ -49,7 +49,7 @@ protected List getAllTables() throws SQLException { } // Execute specified query - protected DataTableModel runQuery(String query, String table) throws SQLException { + protected DataTableModel runQuery(String query) throws SQLException { try (Statement statement = connection.createStatement()) { ResultSet resultSet = statement.executeQuery(query); ResultSetMetaData metaData = resultSet.getMetaData(); diff --git a/app/src/main/java/sqlite/viewer/SQLiteViewer.java b/app/src/main/java/sqlite/viewer/SQLiteViewer.java index e428d51..bfedb9e 100644 --- a/app/src/main/java/sqlite/viewer/SQLiteViewer.java +++ b/app/src/main/java/sqlite/viewer/SQLiteViewer.java @@ -166,10 +166,7 @@ private void initComponents() { queryTextArea.setText(String.format(Driver.SQL_ALL_ROWS, actionEvent.getItem().toString()))); executeButton.addActionListener(actionEvent -> { try (Driver driver = new Driver(fileNameTextField.getText())) { - DataTableModel tableModel = driver.runQuery( - queryTextArea.getText(), - (String) tablesComboBox.getSelectedItem() - ); + DataTableModel tableModel = driver.runQuery(queryTextArea.getText()); table.setModel(tableModel); } catch (SQLException e) { showDialogPane("SQL execution error", e.getMessage());