![download glassfish 5.1 for netbeans 8.2 download glassfish 5.1 for netbeans 8.2](https://i.stack.imgur.com/zjJae.png)
In the next dialog you must choose the database driver you wish to use. Go to the Services tab and right mouse click on New Connection. I assume that the database you wish to connect to already exists. If you have not already started your MySQL DBMS then do that now. It also has additional features for managing a MySQL server but we won’t need those. All that is required is that you create a connection to the database. One feature I have always liked in NetBeans is that it has an interface for working with databases. Step 2: Create a Database Connection in NetBeans
![download glassfish 5.1 for netbeans 8.2 download glassfish 5.1 for netbeans 8.2](https://windows-cdn.softpedia.com/screenshots/GlassFish_3.png)
If you need a driver that NetBeans does have a copy of then Step 1b is your only choice. NetBeans does not replace a driver if one is already in place. If you copy a driver into the lib folder then NetBeans will not replace it with an older driver even if the check box on the Server dialog is checked. Of the connector but the current version is 5.1.34. As of this writing NetBeans contains version 5.1.23 The reason I prefer this approach is that I can be certain that the most recent driver is in use. I recommend Step 1a and manually add the driver. Any code in your web application will not work and all you will likely see are blank pages. Without this file and if you have not copied the driver into GlassFish manually then GlassFish will not be able to connect to the database. We will create in Step 4 of this tutorial. NetBeans determines the driver to copy to GlassFish from the file glassfish-resources.xml that On this dialog you will see a check box labelled Enable JDBC Driver Deployment. Start NetBeans and go to the Services tab, expand Servers and right mouse click on your GlassFish Server.Ĭlick on Properties and the Servers dialog will appear. On my Windows 8.1 system the MySQL driver can be found inĬ:\Program Files\NetBeans 8.0.2\ide\modules\ext. NetBeans has a feature that deploys the database driver to the domain’s lib folder if that driver is in NetBeans’ folder of drivers. Step 1b: Automatically Adding the MySQL driver to the GlassFish Domain If GlassFish is already running then you will have to restart it so that it picks up the new library. On my system the folder is located at C:\Users\Ken\personal_domain\lib. You are looking for the driver file named mysql-connector-java-5.1.34-bin.jar in the archive.Ĭopy the driver file to the lib folder in the directory where you placed your domain. If your OS is Windows download the ZIP archive otherwise download the TAR archive. I recommend downloading the Platform Independent version. Go to the MySql Connector/J download site at and download the latest version. With the exception of Derby, GlassFish does not include the MySQL driver or any other driver in its distribution. Step 1a: Manually Adding the MySQL driver to the GlassFish Domainīefore we even start NetBeans we must do a bit of preliminary work. Steps 1 through 4 are required, Step 5 is optional. As I went through the steps I realized that I needed to record the steps for my students to reference. The other day I presented to my students the steps necessary to make GlassFish responsible for JDBC connections. See my previous article “Creating a New Instance of GlassFish in NetBeans IDE” Instance with its own folder for the domain. It is further assumed that you have replaced the default GlassFish server instance in NetBeans with a new
![download glassfish 5.1 for netbeans 8.2 download glassfish 5.1 for netbeans 8.2](https://i.stack.imgur.com/j33k0.png)
This tutorial assumes that you have installed the Java EE version of NetBeans 8.02.