Reputation: 63
I have a database (called "socializer") residing within MariaDB server and I'm trying to generate JPA entities from tables of that database in Eclipse, but cannot, because schema selection is grayed. Any ideas why?
My setup: Eclipse Neon, Eclipse Link 2.5.2, MariaDB 10.1.19-1, Arch Linux.
I know that the connection to my database has been established, because I can see it listed in Data Source Explorer, but its "Schemas" folder is displayed just empty, although it actually contains a few tables, created and perfectly observed within MySQL Workbench (the other listed databases appear to have empty "Schemas" as well).
JDBC connection properties:
Database: "socializer"
URL: "jdbc:mariadb://localhost:3306/socializer"
User name: root
Password: ""
JDBC driver (Generic JDBC Driver, mariadb-java-client-1.5.5.jar) properties:
Connection URL: "jdbc:mariadb://localhost:3306/socializer"
Database Name: "socializer"
Driver Class: "org.mariadb.jdbc.Driver"
User ID: "root"
And yes, user name and password are ok (ping will fail if either of them is changed).
Upvotes: 6
Views: 7971
Reputation: 67
In my case, I'm connecting to MySQL, and the problem is I need to add JDBC driver to Eclipse.
https://www.javahelps.com/2015/08/add-mysql-jdbc-driver-to-eclipse.html
Then when Eclipse asks you to select a connection profile, select the driver you added (MySQL for me, instead of Generic JDBC), and you should be able to see all schemas.
Upvotes: 0
Reputation: 113
https://www.eclipse.org/datatools/downloads.php
install this plugin, i use 1.14.1 (Oxygen) version then create new jpa tools, choice mysql
Upvotes: 0
Reputation: 49
This Worked For me.... Go to Go to Project -> Properties -> JPA
check both checkboxes
and done.. :)
Upvotes: 2
Reputation: 1353
In Addition to the comments, I found another reason that might cause the problem, that no schema's are listed:
I run into this while trying to connect to another database with other schemas than before.
Go to Project -> Properties -> JPA and disable/uncheck Override default schema from connection
If there is a schema selected that doesn't exist in the selected database, no schemas will be shown when creating entities. For me the problem was, that Eclipse was trying to show a schema from the database before.
Upvotes: 6