Netbeans IDE: how to remove a data source

I have a Java web application containing a Persistence block. In this save module, I can select an existing data source or create a new data source. When I run this assembly web application on the Glassfish server, the data source is created on the assembly in the Glassfish server. A connection pool is also created.

I can remove the data source and / or connection pool in the assembly on the glassfish server. This does not remove the data source from NetBeans. When you restart the web application, data sources and connection pools are restored.

How to remove data source and connection pools in netbeans environment? I can not find this functionality anywhere.

I want to delete existing data sources and connection pools because I am having a problem with a new data source / connection pool. To make sure that no mixing occurs between the data sources / connection pools, I want to delete the old ones that I no longer use.

+6
source share
5 answers

The file you are looking for is called glassfish-resources.xml (or sun-resources.xml). It stores all server resources that are deployed with your application. It can be found in the installation directory of your project (in the NetBeans tag "Files").

+4
source

You need to go to the services window (Ctrl + 5) and expand Severs> GlassFish Server (version)> Resources> JDBC Resources and find unnecessary data sources. Right-click and select "Unregister." This will remove it in all Netbeans projects.

+6
source

NetBeans takes data sources from GlassFish. You can find / edit the domain.xml file. In addition, you can edit the GF admin console.

+1
source

Go to the .xml context and delete the line containing the Resource entry.

Then delete the corresponding "resource-ref" entry from web.xml.

Then clean and create a project.

This solved the data source problem for me.

+1
source

I am using netbeans 8.0.2

In the projects tab of the left search bar of your project tree. There is node other resources . Go through this node, please. glassfish-resources.xml is a sheet in customization . I found all jdbc and other resources there.

So Other resources -> setup -> glassfish-resources.xml

enter image description here

0
source

Source: https://habr.com/ru/post/910170/


All Articles