Making Eclipse for PHP Useful

Out of the box, Eclipse for PHP is lacking a few vital features.

Problem: How do I run SQL queries in Eclipse?

Solution: The SQL Explorer plugin.

To install:

  • Go to Help->Install New Software.
  • Add a new site called SQL Explorer with the URL http://eclipsesql.sourceforge.net/
  • Select SQL Explorer.
  • Keeping clicking Next/Finish until the plugin is installed.

Problem: Okay, I can run some queries now, but not against Microsoft SQL Server!

Solution: Use the jTDS JDBC driver. (Note: In my experience, this driver is much faster and more reliable than the driver you can get from Microsoft.)

To use:

  • Download the latest driver
  • Unzip the download and put the jtds-1.2.5.jar file somewhere safe.
  • In Eclipse, go to Window->Preferences.
  • In the Preferences window, go to SQL Explorer->JDBC Drivers. Select Microsoft MSSQL Server JDBC Driver.
  • Go to the Extra Class Path tab. Click Add JARs and select the jtds-1.2.5.jar you downloaded earlier.
  • Click List Drivers and ensure that net.sourceforge.jtds.jdbc.Driver is in the Driver Class Name box.
  • Your example URL should look like jdbc:jtds:sqlserver://<server_name>:<1433>

Problem: What about editing files on a remote server? The built in Remote System Explorer doesn’t seem to work…

Solution: Use CDT and Target Management (this includes a working version of Remote System Explorer).

To install CDT:

  • Go to Help->Install New Software.
  • Add a new site called CDT with the URL http://download.eclipse.org/tools/cdt/releases/galileo
  • Select Eclipse C/C++ Development Tools.
  • Keeping clicking Next/Finish until the plugin is installed.

To install Target Management (requires CDT):

  • Go to Help->Install New Software.
  • Add a new site called Target Management with the URL http://download.eclipse.org/dsdp/tm/updates/3.1/
  • Select TM and RSE 3.1.1.
  • Keeping clicking Next/Finish until the plugin is installed.

To connect to a Linux box over SSH:

  • Open the Remote System Explorer perspective.
  • Create a new connection, and select SSH Only as the system type.
  • Follow the wizard.

Leave a Reply

Your email address will not be published. Required fields are marked *