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.
- 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.)
- 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:
To install Target Management (requires CDT):
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.