Friday, January 18, 2008

NetBeans and MySQL: What To Do?

I have been getting a number of internal and external emails and phone calls offering ideas and asking me for opinions for what to do in NetBeans now that Sun has a new Very Popular Database.

In case you don't know, I am currently the person responsible for database tooling in NetBeans. Until yesterday, this was going along fairly smoothly, but things just got a little hot around here :).

First of all, I suspect that some folks over in MySQL may have some thoughts and opinions about this :), and so far I haven't had a chance to talk to them. So that's a very important missing piece of the puzzle. I need to figure out when and how I can do that.

But meanwhile, let me share my thoughts and idea around this.

First, I do want to say that we already have pretty good integration with MySQL. The MySQL JDBC driver is included with NetBeans 6.0, and it's pretty darn easy to set up a connection and start browsing your MySQL database


NetBeans is excellent for database programming because the database tooling is integrated with a fully fledged IDE. That means you can do things like generate JPA entities from database tables, generate a desktop CRUD application, generate a RESTful Web Service from a database, and visually bind web page components to database tables.

OK, but what more can we do :).

Well, lots of things. All sorts of things. But what makes sense? That's going to take some thought.

Just as an example, NetBeans is a development environment. Most of the folks I talk to don't believe it should be a database administration tool, because administration is so specific to each database. Sure, we will own and support MySQL, but Sun also distributes and supports PostgreSQL and Java DB, and there are a few other important databases out there that many of our customers use. Do we build admin tools for all of these as well?

That said, I can imagine making it very easy to bring up the MySQL admin tool from NetBeans (and let's not forget the wildly popular open source MySQL admin tool, phpmyadmin. For that matter, we should make it easy to bring up pgAdmin for PostgreSQL. Java DB, bless it's heart, really doesn't need an admin tool, except for start and stop, and we already do that (OK, we could add support for setting properties).

Now that I think of it, probably the best thing would be to let the user register the admin tool they want to use for a given database driver/connection.

There are lots of other things we could do. What about stored procedure support, including debugging? What about integrating MySQL's data modeling functionality into NetBeans? What about making it easy to create a sample database? And so on.

I've set up a Wiki page to gather them all. There is a lot of creative energy around this. Tell us your ideas. Put them on the Wiki page, add a comment to this blog, add a feature request in Issuezilla, or send me an email (david at vancouvering dot com). Let's get this ball rolling!


Alexander Malfait said...

I think it's pretty interesting you propose integrating with fine existing FOSS projects like phpMyAdmin and phpPgAdmin. These tools are both pretty advanced in dealing specifically with their database. You probably already realise just how much you work you would need to do to bring NetBeans support on par with these applications.

Of course you need a PHP enabled webserver to run them. Bundling Apache + PHP might be a bit overkill, on top of requiring a bunch of work to run in the cross platform manner than NetBeans runs today. But maybe you could use Caucho's Quercus implementation, which can run PHP in a pure Java environment.
You could put a plugin in the update center which installs their Resin appserver plus Quercus, bundle the phpmyadmin code, make a little window to configure the basics of and run that. This would make it pretty easy for beginning MySQL users to have a pretty powerful and easy to use admin tool running in no time.

I don't know if you can easily embed a capable browser in NetBeans, but just launching the native browser would be OK I guess.

Good luck to you!

David Van Couvering said...

Great comments, Alexander. I never even thought of bundling phpmyadmin, I was thinking of just making it easy to register. That's still a good first step, but your ideas sound fun.

I looked at the Quercus page, it looks like it plugs into a Java EE app server using standard mechanisms (web.xml)? Glassfish v3 is pretty lightweight and will be optionally included with NetBeans, and maybe Quercus could be plugged into Glassfish to run phpmyadmin. I like the idea of making Quercus and some glue code around it available on the update center.

There is some initial effort to
embed a browser in NetBeans
. I'm not sure when this will be done, but we could definitely take advantage of it. Until then, yes, we can rely on an external browser.