Eclipse Tips

If you want to share your tips about using Eclipse, please email them to me at

Using Eclipse as a database client

Open a SQL file in Eclipse. Right click and select "Use Database Connection..." -> "Create a new connection" -> "Next". In the next screen you'll need to provide the information about your database, and here's mine using PostgreSQL 8.2:

Click "Next" then "Finish".

Now that a database connection is configured, next time when you try to run a SQL script, simply open it, right click and select "Run SQL".

Run Ant Script within Eclipse

Suppose we have a build file in our project, e.g. build.xml, which contains a target called hello. We can of course run this target by going to the command line and type: ant hello. We can also run this target inside Eclipse as follows:

Note that after you run the target once, next time if you want to run it, you can simple select it from the drop-down menu of the "External Tools" button on the toolbar.