Release 1.x‎ > ‎Development‎ > ‎NetBeans‎ > ‎

Service JDBC

Create a "OpenPTK-Service-JDBC" NetBeans Project that maps the Project OpenPTK's Service for JDBC. The Java Database Connectivity (JDBC) Service is currently under development and incomplete.

New Project

  1. From the File menu, select New Project
  2. From the Categories Pane, select "Java"
  3. From the Projects Pane, select "Java Project with Existing Source"
  4. Click the "Next >" button

Name and Location

Specify the name of the new NetBeans project and where it will be located. 
  1. Set the Project Name to OpenPTK-Service-JDBC
  2. Use the Browse button and select the the ${NB_HOME} directory. Make sure the Project Folder is set to the ${NB_HOME} directory with a sub-directory name that matches the Project Name: /work/Software/netbeans/openptk/OpenPTK-Service-JDBC
  3. Click the "Next >" button

Existing Sources

Add Project OpenPTK source files for the Service JDBC. 
  1. Use the "Add Folder ..." button to locate the "src" folder. This folder will be under the ${PTK_HOME} directory as a sub-directory. The directory pathname to the src folder is: /work/Software/openptk/projects/OpenPTK/Service/JDBC/src
  2. Click the "Next >" button

Includes and Excludes:

The last dialog will show all the Java files that will be referenced by the new NetBeans Project. This dialog allows you to include and/or exclude other files. No changes will be made. 
Click the "Finish" button. 
NetBeans will create the new Project.

Verify New Project

After the project has been created, verify it's components. Select the "Projects" tab and the "Files" tab. Explore tabs to verify the components of the new Project. 
See the images below:

Resolve Dependencies

From the section above, "Verify New Project", notice that the Project is marked with a red exclamation symbol. This symbol indicates that there are references to other packages and/or libraries that are not resolved. 
We need to configure this Project use the following:

  • OpenPTK-Framework NetBeans Project.

  1. Select the OpenPTK-Service-JNDI Project, from the Projects panel, if it is not already selected.
  2. From the File menu, select the menu item OpenPTK-Service-JDBC Properties
  3. From the Categories pane, Select the Libraries item
  4. From the Compile-Time Libraries: pane, click the "Add Project ..." button.
  5. Using the Add Project panel, locate the OpenPTK-Framework NetBeans Project. For this document, it is located in the ${NB_HOME} directory.
  6. Select the OpenPTK-Framework Project and click the Add Project JAR File button.
  7. From the Compile-Time Librarties: pane, click the Add JAR/Folder button.
  8. Using the Add JAR/Folder panel, locate the necessary JAR files. These JAR files are in the ${PTK_HOME}/lib directory.
  9. Select the mysqljdbc.jar file and click the Choose button
  10. Click the OK button on the Project Properties panel.

Clean and Build

You can now build the project. Select the OpenPTK-Service-JDBC Project from the Projects panel. Right-click on the selected project and select Clean and Build. The Project should build successfully.