8

I am using netbeans IDE 7.1. I am trying to generate entity classes from a database(sql server). I am able to setup the connection to this remote datasource but in the New Entity Classes from database Wizard the tables are not showing up and at the bottom it says select atleast one table.

I could execute queries and browse through the tables from the netbeans databases service.

Can someone help me to fix this..

Thanks

Sampath Pasupunuri
  • 628
  • 1
  • 13
  • 25

4 Answers4

6

maybe your schema is not selected correctly, check on service windows->database->your connection(the bold schema is a default selected schema) if it wrong, right-click->properties, and change your schema to public, all the tables that you created are here normally hope useful :)

Yusuf1494
  • 252
  • 1
  • 5
  • 16
  • Still on Apache NetBeans IDE 12: create connection inside windows -> database. Afterwards stop and start NetBeans IDE. This worked for me and the connection is shown inside generating entity class from database. – ChristophS Jun 25 '21 at 10:10
1

I faced this issue and the only way I could get it to work was to create a new connection every time. Once i created a new connection it would show me the tables and I could use it, otherwise it would just leave the list empty

Sam Holder
  • 32,535
  • 13
  • 101
  • 181
1

In the newer versions of NetBeans if you create a database connection with default schema, it will take mysql as schema name and generate the connection string.

So goto your DB connection in NetBeans and edit your connection url.

Example :

Change

jdbc:mysql://localhost:3306/mysql?zeroDateTimeBehavior=CONVERT_TO_NULL

to

jdbc:mysql://localhost:3306/YOUR_SCHEMA_NAME?zeroDateTimeBehavior=CONVERT_TO_NULL (add your schema name in the connection string and save)

Selvam Raju
  • 196
  • 4
  • 14
0

I had to go into Glassfish console and create a special connnection pool and resource. The connection pool had to be res-type="java.sql.Driver" (not datasource). Then when creating my entity, I picked this new resource from the list and it worked, my tables showed up.

nettie
  • 628
  • 1
  • 11
  • 23