Database Console Execute Disabled

Answered

I'm using an H2 Embedded database in IntelliJ Ultimate Addition 2019.2.4. I have set up a connection to my database ages ago and it has always worked fined for debugging SQL commands in the console. But when I opened the DB Console now it no longer has the Execute (Green play button) enabled.

If I double-click on a table it will display the contents of that table, but the console doesn't appear to be connected.

I don't see an error in the Event Log. Any idea what happened? How do I get the Execute Button Back.

0
15 comments

Is it SQL file or SQL console? Make sure it is has H2 sql dialect set and is associated with the data source.

0

It was an SQL Console that I opened with the Context Menu from the Database Explorer frame. I tried creating a new project and connecting to the same database. Same problem Then, I navigated to the Scratches and Consoles in the browser and brought up the context menu fro that console. There was no option to Attach. So,based on you suggestion, I created a .SQL file and it behaved the same way until I open the context menu for that .SQL file and attached it to the console for the database connection. And then everything worked. The file and the console now has the green arrow and I can execute SQL. Yeah! Not sure if this is a permanent fix or not. But thanks for the hint.

0

Hi!

I have a similar problem. In Intellij IDEA Ultimate for a project I added a MySQL connection with the name Local. I can list the schemas and the tables inside them. Also, if I double click on a table it lists the rows in the table (the window has the users [Local] name).

If I click on the Jump to Query Console... icon, select console (Default) and enter a simple SELECT * FROM users query the Execute button is disabled.

I tried to right click inside the editor and Change dialect to... MySQL, and also tried to Switch Session to console, but the Execute button is still disabled.

I would like to switch from MySQL Workbench to Intellij IDEA Ultimate to manage my databases, but this problem makes it impossible because I have to manually execute queries very often.

Any idea how to get the Execute button working again?

0

could you please attach a screenshot like this one?

0

On the left you can see the content of the table faq.

On the middle you can see the Query Console with the inactive Execute button.

On the right you can see that it is connected to the database and the list of tables.

(No sensitive information on the screenshot)

0

I may have found something.

When I tried to use IntelliJ IDEA Ultimate to manage databases, I wanted to use the bundled official Database Tools and SQL plugin, so I disabled the Database Navigator plugin. After re-enabling the Database Navigator pluging the Execute button become active again - without adding any connection in Database Navigator. The Database Tools and SQL's description says that it has the Ability to execute queries but it doesn't mention that it depends on an another plugin to have that ability active.

Is this a normal behavior?

0

It does not depend on "DB Navigator", it is a third party plugin. Could you please remove it completely, restart IDE, create new console and check behavior?

0

I completely removed Database Navigator, restarted IDE, removed the data source and added it again, but the Execute button is disabled again. I tried to delete the console and create a new one, but it doesn't helped. Execute button is disabled.

0

We can't reproduce this issue. Please try to reset IDE settings to default via File -> Manage IDE settings -> Restore defaults.

0

After Restore Default Settings the Execute button is active again. (But I have to reconfigure the whole IDE again...)

0

I have exactly the same behaviour on Ultimate 2020.3.2 and 2020.3.3 using Oracle. I had previously installed DB Navigator and migrated from CE to Ultimate.

0

This is caused by the following entry in Application Support/JetBrains/Intellij.../options/filetypes.xml:

<removed_mapping ext="sql" approved="true" type="SQL" />

Removing this line fixes the issue.

6

Got the same issue in 2022.2, thanks for the solution :)

0

I confirm this fix for IDEA 2022.2.1. What setting option is <removed_mapping>? How it appeared in file?

0

Vanav, it can be appeared due to accidentally removing SQL files from the file patterns list.

0

Please sign in to leave a comment.