The name of the driver class for the datasource is missing (Netbeans+ PostgreSql + Glassfish)

前端 未结 9 1883
情话喂你
情话喂你 2020-12-16 02:31

I\'m trying to develop an EJB application using Netbeans 8 on a Postgres 9.2 db and Glassfish 4 server.

Once I created connection pool and JDBC resources in the glas

9条回答
  •  春和景丽
    2020-12-16 03:10

    For me the issue was that I had added a new JDBC driver JAR file to Glassfish, but I hadn't added it to NetBeans.

    The first step is to copy your JAR file to NetBean's EXT folder. For me, that folder is: "C:\Program Files\NetBeans 8.0.1\ide\modules\ext"

    Next, we need to add the JDBC driver as described below:

    • In NetBeans, select Window > Services menu option which adds the Services tab to the explorer panel.
    • Expand the "Database" tree node
    • Right click on the "Drivers" tree node and select "New Driver..."
    • In the "New JDBC Driver" window press "Add..." which opens a dialog that says "Select Driver".
    • Navigate to the EXT folder where you copied your JAR file and select the JAR file.
    • Press OK.
    • The new driver will be added to the list.

    When I attempted to create an "Entity class from database", I still ran into issues when I selected my connection. After trying various things what worked for me was to:

    • Open the Database tree node again and delete each of the database connections.
    • Return to the Projects tabs and go through the steps to create an "Entity class from database".
    • When the dialog appears, in the drop down select "New Data Source".
    • Select the driver and then enter the information for your database.
    • After recreating the connection I was able to create the Entity class from the selected database table.

    Good luck!

提交回复
热议问题