Reputation: 1539
I am trying to create a JPA project, and eclipse does connect to the database, but no tables are shown. The database do have tables, and the user "john" have all permits in the database. There is no problem executing queries from the prompt or using a MySQL client.
Here is the connection setup in "Driver Properties":
Drivers: MySQL JDBC Driver
Database: myDatabase
URL: jdbc:mysql://localhost:3306
username: john
password: ******
The "Test connection" button works fine, the connection is estabilished, but in the tables folder, it is empty.
Using jre7, tomcat 7.0, Mysql 5.6.0, Eclipse Luna 4.4.2, mysql-connector-java-5.1.18.jar
Upvotes: 3
Views: 3213
Reputation: 1539
The connection String should list the schema.
Source: https://www.eclipse.org/forums/index.php?t=msg&th=155563&goto=675194&#msg_675194
So, if the JDBC connection string is only like:
jdbc:mysql://[server_name]:3306/ instead of
jdbc:mysql://[server_name]:3306/[schema_name]than Eclipse shows no tables neither in Database Explorer, nor in JPA table generation.
Changing the connection string from
jdbc:mysql://localhost:3306
to
jdbc:mysql://localhost:3306/myDatabase
correctly displays the tables.
Upvotes: 10