Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

intellij idea data sources doesn't see existing table in the database

intellij idea data sources doesn't see existing table in my mysql database, while Netbeans see it. i've created a table in the database. When i create connection in intellij idea data sources, it sees my scheme, i do select it in "schemas and tables" but then i don't see it in the list. every schema, but mine's. When i try to connect to it with netbeans or mysql workbench, it's just ok. same story with several databases, with root access, too. any table, but mine's. what could be wrong?

i see question like mine's here, related to visual studio, no answer. please, give a good clue

like image 791
WebComer Avatar asked Sep 06 '12 10:09

WebComer


People also ask

How do I View tables in IntelliJ?

To view a table, double-click the table. For more information about different viewing modes, see View data. The available data sources are shown as a tree of data sources, schemas, tables and columns. If no data sources are currently defined, use the New command Alt+Insert to create a data source.

How does IntelliJ connect to Database?

To add a new database connection (called a data source in IntelliJ), open the Database window View -> Tool Windows -> Databases, then click the + sign and select Data Source and then MySQL from the sub-menu.


2 Answers

I had the same problem in IntelliJ IDEA 15.

I fixed it by right clicking the data source -> Properties -> Schemas -> Use legacy introspector.

like image 156
Kevin Van Ryckegem Avatar answered Sep 22 '22 21:09

Kevin Van Ryckegem


I found the reason of problem for HSQLDB: There is IDEA bug (i have 11.0 version).

Create db with relative path (relative of MODULE), like this:

jdbc:hsqldb:file:db_file/testDBInMemory;shutdown=true;hsqldb.write_delay=‌​false;
f:\TestModule\db_file\

When added it to Data Sources, IDEA recognizes this path as relative of $IDEA_HOME$/bin folder.

f:\Program Files\JetBrains\IntelliJ IDEA 11.0\bin\db_file\

So you have two different data bases. And when JPA updated first, Data Source doesn't see update in other.

WORKAROUND: use absolute path in file db url.

like image 43
Kinjeiro Avatar answered Sep 24 '22 21:09

Kinjeiro