Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Simple MySQL Integration into NetBeans IDE 6.0

DZone's Guide to

Simple MySQL Integration into NetBeans IDE 6.0

· Database Zone ·
Free Resource

MariaDB TX, proven in production and driven by the community, is a complete database solution for any and every enterprise — a modern database for modern applications.

To celebrate Sun's MySQL acquisition, here's some further NetBeans/MySQL integration (on top of that provided by 6.0, by default, by means of which you can register a MySQL connection, start/stop and even create MySQL databases). It is a work in progress but suggests that a lot more is possible.

First, I followed the Options Window Module Tutorial and ended up with an extension to the Options window:

Then, as explained in the above tutorial, I passed on the file identified above and used it in a menu item's performAction:

Preferences pref = NbPreferences.forModule(MysqlPanel.class);
String app = pref.get("MySQLAdminLoc", "");

public void performAction() {

try {
NbProcessDescriptor desc = new NbProcessDescriptor(app, "");
Process process = desc.exec();
process.waitFor();
} catch (InterruptedException ex) {
JOptionPane.showMessageDialog(null, "Specify the location of " +
"the MySQL Admin console" +
" in the Options window!");
} catch (IOException ex) {
JOptionPane.showMessageDialog(null, "Specify the location of " +
"the MySQL Admin console" +
" in the Options window!");
}

}

This is how the menu item looks:

When selected, the MySQL Admin dialog opens:

It would be best if it did not open as a modal dialog, but I don't think I can do anything to change that.

 

MariaDB AX is an open source database for modern analytics: distributed, columnar and easy to use.

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}