Wednesday, January 26, 2005

Tomcat, ANT, CVS, Success in the Enterprise - Part 1

After two long days of mostly business-side meetings about my group's focus at work, our choices to use open source tools has been validated by a landslide.

First, ANT. When asked who else in the company uses ANT, which I did not know, someone thankfully chimed in and stated that both of the other two main Java-based development groups use ANT with great success.

Second, CVS. The long-since-promoted to management senior manager present had used CVS in the past. Not only was the choice of CVS validated, but there was much relief and satisfaction that we moved from a flat-file-tar.gz archives method of backing up source, to a full-blown concurrent versioning system (CVS).

Most importantly, Tomcat. This is not simply a tool enabling our development - it is a platform that we will use to develop on, deploy to, and run our production systems on. I say systems because we use Apache-AXIS for SOAP serving, and vanilla Tomcat for our web apps.

I found out that one of the major Java groups (which has been flailing about recently) has used (drum-roll) BEA WebLogic for their failing platform. They are riddled with both organizational issues as well as development issues. In short: they move like molassas. This other group has failed to embrace the new cross-enterprise focus on SOAP for our middleware, and takes eons to deploy new and simple features.

The Sr. Management present congratulated us on our success migrating to Tomcat, and hopes that our documentation and technical leadership will be a foundation for other groups to build on.

I always thought that using open source in a large enterprise would be a struggle. Today I know, it is not.

Saturday, January 08, 2005

About MySQL, Java, and good Prototypes

Over the holiday period at work most of my team was on vacation. Thus, I was left to "special projects". My group and I decided that a good project-prototype would be a SQL/RDBMS backed complete re-working of an existing form on our website. By form - imagine a form with about 20 complex fields for working with a command-line based back-end legacy system.

The goals of the prototype were simple:
Allow users of a complex app to save their form inputs in named templates.
Allow users to retrieve templates at any time, with an easy/natural UI.
Get this done - including installing MySQL & learning it's quirks in less than 4 days.

I have to say: the OSS community rocked. Soo many people out there using MySQL posted tutorials & FAQs on MySQL <-> Java usage, that rarely was I stuck on a problem. The only thing that got me - more of a Java issue, was that I had an old javax(?)-naming.jar in our web application lib dir (from when it was on JServ) that broke the more recent JNDI naming in Tomcat. Once I removed the outdated ...-naming.jar file, everything fell into place.

Having used JDBC (the java API for database connectivity) I was no stranger to the issues of using an RDBMS concurrently for the many simultaneous users of a web application. I started looking for a database/resource connection-pool and it was immediately clear: Apache-Tomcat includes a very robust connection pool! That was one of the only things I was about to miss from using WebLogic. So - after setting up the Jakarta-Commons based database connection pool (DBCP), I was ready to begin on my code.

In just a few hours, I had a basic schema, users, and a FREE tool for schema mgmt, backups, and general MySQL Admin. The tool I use is SQLYog. These guys realized that they'd never compete with the free tools (php-MySQL) if they didn't have a free 'lite' version. So, with this great windows-UI based tool installed and a few hours work, I was up and running - even with nice printouts of my schema (and html to email around).

To wrap it up - this article is intended to give confidence to anyone considering MySQL as a back-end for any Java project, not necessarily a web based one. The driver works well and the documentation is fantastic. In less time than purchasing and our IT-Unix Support group could have installed any of the non-free/OSS RDBMS systems, I had a fully working prototype ready to show-off. It was good enough, that it's now commissioned into a full project that will include upgrading a few other features and polishing the UI to work in both standalone (IE/FF) browsers as well as PDA browsers such as those in RIM devices.

MySQL + Java + Rapid Development = Success.