Eclipse, Tomcat and MySQL for Java Web Development

I am currently working on a web development project for school. Eclipse is pretty much a given. Tomcat is required by the guidelines and I decided to go with the MySQL as my database server. I took the instructions from this page. But here is my “Pro-Version” synopsis for savvy people who just want to get going. My system is a Windows 7 64-bit but this should be valid just about anywhere because these are platform independent bundles.

  1. Install the latest JDK if you haven’t already. (I am working of 7u5)
  2. Install Tomcat. You can lay it down anywhere, it’s just an unpack. (I use 7)
  3. Install Eclipse. It’s also an unpack. Unless you’re not doing Java at all (and here you are) there is no reason not to go for the JavaEE version which contains just about everything. (I use the Juno version)
  4. Make sure Eclipse knows where you’ve put your jdk. (If it’s not automatic, I’m sure you can figure it out by yourself)
  5. Install MySQL Community Edition (I have 5.5.27). Check in as new user and then select to skip the process. The installation itself is pretty straight forward. You’ll most likely want the developer install. And don’t forget to grab the connector/j library (Mine is 5.1.21) as well.
  6. Put connector/j library in a place you can find it. Like in the Java main directory or with your project.
  7. Go into your MySQL command prompt and create a new database (“create database something;”).
  8. Go back to Eclipse and open the Data Source Explorer view.
  9. Right click on Database Connections and select new.
  10. Select MySQL and rename it to whatever you want. This is the name of the connection you will have listed.
  11. In the open window you will see practically nothing. Click the New Driver Definition.
  12. Select the latest JDBC driver.
  13. Click the JAR list tab and clear everything there. Add the connector/j jar.
  14. Head over to the Properties tab. In the connection URL, make sure you write your database name as you created it. The Database Name field is for display purposes. Also make sure the user and password fields are correct to match your installation. Then hit OK.
  15. Now your empty window from before should actually display something. To make sure everything is as it should, cllick Test Connection.
  16. If everything worked, you should get a ping succeeded message. If not, go back and see what you did wrong. It could be that you didn’t start your MySQL server at all after you installed it. Who knows.
  17. But if it worked, your database connection and database should be displayed on the list.

Posted in High-Tech, School by with comments disabled.