X

Geertjan's Blog

  • March 22, 2009

New Tutorial for NetBeans Platform Developers

Geertjan Wielenga
Product Manager
This tutorial shows you how to integrate a MySQL database into a NetBeans Platform application. We start by exploring a MySQL database, for which we create an entity class. However, note that these instructions are not applicable to MySQL only. Rather, they are relevant to any relational database supported by NetBeans IDE. Next, we wrap the entity class into a module, together with modules for the related JPA JARS.

Once the above modules are part of our application, we create a new module that provides the user interface for our application. The new module gives the user a tree hierarchy showing data from the database. We then create another module that lets the user edit the data displayed by the first module. By separating the viewer from the editor in distinct modules, we will enable the user to install a different editor for the same viewer, since different editors could be created by external vendors, some commercially and some for free. It is this flexibility that the modular architecture of the NetBeans Platform makes possible.

Once we have an editor, we begin adding CRUD functionality. First, the "R", standing for "Read", is handled by the viewer described above. Next, the "U" for "Update" is handled, followed by the "C" for "Create", and the "D" for "Delete".

At the end of the tutorial, you will have learned about a range of NetBeans Platform features that help you in creating applications of this kind. For example, you will have learned about the UndoRedo.Manager and the ExplorerManager, as well as NetBeans Platform Swing components, such as TopComponent and BeanTreeView.

Click here to start working on this brand new tutorial:

http://platform.netbeans.org/tutorials/nbm-crud.html

Any feedback is more than welcome.

Join the discussion

Comments ( 4 )
  • hantsy Sunday, March 22, 2009

    Good tutorial.

    I wonder where to get the sample code


  • Geertjan Monday, March 23, 2009

    Hi hantsy. Thanks for liking the tutorial. The problem with the source code is that it also includes all the extra JARs and so on, as well as the problem that it wouldn't run out of the box since it assumes you have the particular database used in the tutorial. So I'm not sure if it would make sense to make the source code available since it can't be used "as is" anyway.


  • Roger Tuesday, March 24, 2009

    Hi Geertjan,

    Might you can organize the project's libraries, and as well use an embedded db (like derby).


  • Geertjan Tuesday, March 24, 2009

    Well, I was supposed to use MySQL since that's the official Sun database server (yes, Derby too, but anyway).


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha