Saturday Oct 06, 2012

Test JPQL with NetBeans IDE 7.3 Tools

Since I pretty much messed up this part of the "Unlocking Java EE 6 Platform" demo, which I did together with PrimeFaces lead Çağatay Çivici during JavaOne 2012, I feel obliged to blog about it to clarify what should have happened! In my own defense, I only learned about this feature 15 minutes before the session started. In 7.3 Beta, it works for Java SE projects, while for Maven-based web projects, you need a post 7.3 Beta build, which is what I set up for my demo right before it started. Then I saw that the feature was there, without actually trying it out, which resulted in that part of the demo being a bit messy. And thanks to whoever it was in the audience who shouted out how to use it correctly!

Screenshots below show everything related to this new feature, available from 7.3 onwards, which means you can try out your JPQL queries right within the IDE, without deploying the application (you only need to build it since the queries are run on the compiled classes):

SQL view:

Result view for the above:

Here, you see the result of a more specific query, i.e., check that a record with a specific name value is present in the database:

Also note that there is code completion within the editor part of the dialog above. I.e., as you press Ctrl-Space, you'll see context-sensitive suggestions for filling out the query. All this is pretty cool stuff! Saves time because now there's no need to deploy the app to check the database connection.


Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.


« October 2012 »