Thursday 10 April 2008

NetBeans 6.1 & MySQL

As we all know few months ago SUN Microsystems acquired MySQL AB - the vendor of (still) the most popular open source database server. Did this make an impact on the SUN's preferred JAVA IDE? Well the answer is easily noticeable when comparing the 6.0 and the 6.1 (still Beta and still evaluating) versions. In the 'Services' tab of the IDE there's always been a 'Databases' node introducing set of supported JDBC drivers and predefined connections. Since JAVA 6 (and consequently NetBeans 6.0) the JavaDB (also known as Apache-Derby) was presented and strongly supported with its Embedded and Network drivers. Defining connections through drivers for MySQL and PostgreSQL database servers was also supported.
Now in the 6.1 version we see much stronger support for JavaDB and MySQL. They're separated in their own database nodes, which has enhanced controls over the server management and properties.


The extended administration support lets you redefine the default start and stop commands for the server with custom arguments. Once defined the right way those commands are available in the MySQL node's context menu.
It also makes possible in the 'Admin Properties' to choose any MySQL aware application as additional administration tool - not only the vendor's applications from the GUI tools package, but really any Windows application.


Once connected to a Schema on the MySQL server, you may expand the connection icon and three folders are available, for the three major database objects supported by MySQL - Tables, Views and Procedures.
NetBeans is a powerful database editor, supporting creation and management of databases and their objects by comfortable specialized dialogs or just by executing SQL scripts in the code editor.
Quick table creation is available through this dialog:


It looks easy and really is. If this is not sophisticated enough for you, just choose 'Execute command ...' option from the context menu. A text editing window opens, where you can describe in SQL any table structure you like.
Maybe the most advanced feature is the 'Design Query ...' window (available in the context menu of the table's columns. Its visual approach makes creating complex queries more intuitive and fast.


In the end it might be stated that creating Java database-driven applications with MySQL back-end have always been non-trivial task, involving different tools. Applications for database administration and query design; for schema design and entity relationship management. Let's not forget the IDE for code creation. Now with the 6.1 version of NetBeans the control shifts toward one single tool - the IDE itself. This could help the developer be more focused and shorten the completion time for their project, no matter if it is in Java, Ruby or C++.
I think this is a good start and in the future versions the MySQL support and database support as a whole will be enhanced further. With such excellent UML designer one might expect that ERD for databases will also be supported.
So whatever course might be taken from now on in the MySQL-NetBeans community, the results will be expected with great impatience from me. Good Luck!

2 comments:

Unknown said...

what to do incase if we dont get the Java DB node in IDE 6.1

johnniepop said...

Well, RuchiBhatt, I haven't come across such a case. The most similar case I've seen was when there wasn't JavaDB installed on the machine the NetBeans was on. Even in that case there still was a Java DB node in Services > DataBases. In this situation I just had to install JavaBD somewhere on the hard drive and register it with the IDE (right click on Datbases node and choose New connection...).
I can't quite remember the exact version but on some of the prior versions of NetBeans (may be it was 5.5) the JavaDB registration and management was available in the main menu under Tools.
In fact I think the best choice is migrating to NetBeans 6.5. The JavaDB support is tightly integrated in there and you don't have to search for that support into the Plugins.
Also, I don't know what version of JDK you're eager or have to work with, but the latest JDK (1.6 U11) comes bundled with that data base. It is being installed under C:\Program Files\Sun\JavaDB.

I hope I gave you some useful pointers.