jQuery, PHP and CSS.. NetBeans IDE Still Rocks..

Recently, got an opportunity to do some implementation using Ajax and PHP. Having previously used NetBeans IDE 6.1/6.5 for PHP, it was an obvious choice to come back to NetBeans IDE again.

Although, I am yet to download the latest version, I am currently using 6.8 and I enjoyed every bit of it, while playing with CSS and jQuery for the first time, while implementing Ajax with PHP.

As I am gonna stay with PHP for sometime now, so I guess I better get my NetBeans IDE upgraded, before I miss out on any useful features.

It’s good to be back 🙂

Reviewing NetBeans Book

This year, I received an email from Packt Publishing, inviting me to review one of the books based on NetBeans IDE, Java EE 5 Development with NetBeans 6. I was quite excited about this opportunity and after exchanging few mails with their Market Research Executive, accepted the invitation.

After nearly 2 months, I was able to finish reading the book and here’s my review of the book. Read it carefully and I feel you would enjoy reading the book as I did, because of its easy reading style and effectiveness of communicating complex topics.

Stay tuned..

SQL Editor and NetBeans | #1

In the previous blog, I mentioned SQL Editor. NetBeans has improved it in every release in the past 2 years and it looks great these days. Here’s a sneak-peek;

Click to enlarge!

This figure shows the SQL Editor window along with the results shown for the command executed, written in the editor (select * from nbusers). Also, you can see numerous toolbar buttons, and results are shown in similar way as if it was any CRUD application. We will discuss this in more detail in following section and follow-up blogs.

Key Features..

Execute Command

To execute any SQL query within the NetBeans IDE, you must write the necessary queries in the SQL Editor shown above. Then, you may use a shortcut key (Ctrl-Shift-E) or make use of the icon (Run SQL (Ctrl+Shift+E)), clicking this toolbar button will execute the queries against the selected database (shown in drop-down list of Connection‘s), and relevant feedback is generated in the Output window (see figure). Also, results are shown as mentioned earlier.

Click to enlarge!

SQL History

Now, we will have a look at another cool feature, known as SQL History. You can read more about it on some of the Sun blogs written by;

John Baker

A new database feature in NetBeans 6.5 is the ability to save and reuse SQL statements that have been executed. A dialog listing SQL statements along with the date executed can be opened from the SQL Editor by right-clicking within the editor and choosing SQL History or clicking an image button for SQL History in the SQL Editor toolbar.

James Branam

The order the statements appears in is descending, the more recently executed statement appears at the top of the dialog. To help search for an SQL statement, you can choose the connection for the database against which the statement was executed.

Here’s a quick view of the feature;

Click to enlarge!

Integration with Database Explorer

This is also one of the coolest features about SQL Editor, i.e. its integrated with Database Explorer shown in Services window, goto “Window | Services” or hit the shortcut keys (Ctrl+5) on Windows Operating System to access the window.

Click to enlarge!

This figure shows Database Explorer on the left, while the SQL Editor on the right and Output window at the bottom of the two. Here you could see database (created for demonstration) named prayogshala is connected on MySQL Server running on localhost. It has only one table named nbusers, which consists of attributes (username, firstname, lastname).

Blast from the Past,

I google’d a bit about the presence of NetBeans SQL Editor on Sun blogosphere and I was amazed to find a blog which dates back to Year 2005, when SQL Editor was first introduced into the NetBeans IDE. It was none other than, Geertjan Wielenga who blogged about it…

One area that’s improved significantly in NetBeans IDE 5.0 is the SQL Editor. In fact, there never was an SQL Editor before. In NetBeans IDE 4.1 — and the releases before that — you had a very small space where you could type SQL commands for sending to the database.

Also, you could read more about the SQL Editor and related features from “David Van Couvering’s blog”, Embedding of SQL Editor support into PHP Editor from the “NetBeans PHP Team’s blog”. Finally, don’t miss out on the award-winning plugin (PL/SQL Editor) created during NetBeans Innovator Grants.

This is in fact my 150th blog entry over here.
Indeed, its a special one!


So, this was just a brief overview of the features currently supported by NetBeans IDE. The follow-up blogs will continue to focus on either some/all of these features in detail.

This blog has been contributed to NetBeans Community Docs Program and for latest updates on this content, refer to the contribution.

Stay tuned for more..

MySQL, NetBeans and SQL Editor

I have been busy lately thanks to my internship project, which almost got screwed up. I was working in a team of 4 people, where we were building a web application, that was initially deployed at JBoss Server using JBoss Eclipse IDE (old version). Also, we had to interact with the centralized Oracle Server to setup our database for running the website.

Now, having being trained on some of those technologies in past few months, I thought it won’t be much of an issue. However, at the beginning of this month, I faced some weird issues which had no obvious answers. There weren’t any silly mistakes either. We were facing some issues with Oracle connectivity. I am not blaming Oracle or the company where we did the project. But, mix of old and new technologies, turned out to be quite confusing resulting in lot of trouble.

We were running out of time, so we decided to migrate our database to MySQL Server and use NetBeans 6.5 IDE, instead of old version of Eclipse. In the last 2 weeks, we were changing IDE’s, Servers and what not? After surpassing many hurdles, we completed the project and deployed it on the intranet with no issues.

Technologies Used

Servers: Apache Tomcat 6.0 Server running on one system, while the MySQL Server 4.x running on some other system.

Integrated Development Environments: JBoss IDE for Eclipse (2.0.0.beta2), Adobe Flex Builder 3 (Trial Version) and NetBeans 6.5


Although, we faced many hurdles while we strive towards  the project completion, I picked up many skills and learned many tricks to speed up the development. It was an amazing experience and certainly enriching one! Stay tuned to my blog to learn a few.

Also, I loved using SQL Editor provided by NetBeans IDE, it was so easy to manage the databases. Whenever you “Execute Command…” any SQL query, the data shown in form of the table is basically a CRUD application. It looked like the Java Application, you could have made using Swing Application Framework in NetBeans IDE. In the following blogs, you would get to know more about SQL Editor. Now, internship is over and I am back in my home town.

taT | “Deploy on Build” Using JBoss

Recently, I had asked a question on NetBeans Forums on the “Deploy-on-Save” feature supported by NetBeans 6.5 IDE. Well, I know I can’t configure build script in such a way, so that it can deploy on save. However, I found a trick to deploy the war file everytime I build OR clean and build .

Brief Overview

This trick will save your time and do lot more stuff with an existing shortcut, which you might have missed otherwise. Actually, I was working on a “Dynamic Web project” in Eclipse IDE where I was supposed to make use of its 2.0.0.Beta2 version using JBoss 4.0.5 GA (with Java EE Platform set to “J2EE 1.4” ). Eclipse was so slow and its editor support for JSP pages was doing no good. Probably, if I could have used a new release of Eclipse, then that might have helped. Still, I am not sure, its just an assumption.

Also, everytime I made changes I had to first right-click project node, then select “Run As > Run on Server” and if I made any changes during runtime, it was not deploying automatically. Although, “Project” menu showed project to be build automatically . So, I had to repeat the cycle again and again.

Due to the above stated issues/problems, I decided to import the complete project into NetBeans 6.5 IDE. Import was successful and I added the JBoss server into NetBeans IDE (“Tools > Servers” ). Now, project is successfully building and deploying. Its absolutely working fine.

Now, NetBeans 6.5 didn’t supported “Deploy on Save” feature for the web applications that were using JBoss Application Server (I am referring to the above release), as per my recent observation.

Then, when I made changes to the webpages in the earlier mentioned project, I still couldn’t deploy on save/build. So, I had to right-click the “Project Node” and click “Deploy”. This cycle is shorter one, still frustating if one makes changes frequently.


Now, open your project’s build.xml file and here’s the trick you need to do;
Add the following tags;

  <target name="-post-dist">
    <!--antcall target="run-deploy" inheritrefs="-init-deploy-ant"/-->
    <antcall target="run-display-browser" inheritrefs="-init-deploy-ant"/>


  <import file="nbproject/build-impl.xml"/>

This was done to override the above mentioned target present in build-impl.xml file, but thats empty.

    <target name="-post-dist">
        <!-- Empty placeholder for easier customization. -->
        <!-- You can override this target in the ../build.xml file. -->

Now, whenever you do “Shift-F11” or “F11”, it will “clean & build” or “build” respectively and then, deploy the project to the server.

Tips to Remember..

If you replace the following tag;

    <antcall target="run-display-browser" inheritrefs="-init-deploy-ant"/>


    <antcall target="run-deploy" inheritrefs="-init-deploy-ant"/>

The moment you use “Shift-F11” or “F11”, the project will deploy the “war” file, however it will not run the browser for you, as it was doing earlier. If you have better solution, or encounter some problems, do let me know. Hope this helps.

This blog has been contributed to NetBeans Community Docs Program and for latest updates on this content, refer to the contribution.

Enjoy NetBeaning!