A REVIEW OF SQLEXPLORER PLUG-IN

类别:Java 点击:0 评论:0 推荐:

Plug-in Overview
SQLExplorer perspective contains the following views: Drivers, Aliases (in a tabbed dialog to the top left), Connections (by itself in the bottom left), SQL Results (again, by itself in the bottom middle), Database Structure View, Connection Info, and SQL History (in the right-hand tabbed panel). The middle of the SQLExplorer perspective is reserved for editors. Note that you enter SQL statements by editing files with the .sql suffix.

To start using SQLExplorer, you need to select your database in the Drivers view. (When it is selected, it will have a red X beside it.) Next, click your right mouse button and select Change Selected Driver. The Modify Driver panel will pop up. Next, you'll need to click on the Extra Class Path tab, click the Add button, and then search and select your JDBC driver's JAR file. Note the JDBC driver name you already be qualified.

To connect to your database, you'll want to set up an Alias that points back to your driver. Select the Alias tab, then click on the new Create New Alias icon. In the New Alias dialog, key the name of your database and set the URL, user name, and password.

The Aliases view displays a list of all database aliases. To connect to that database, select your alias and click the Open menu option. The Connection panel then prompts you to specify a user and password. (The one specified in the Create New Alias will be the default.) Click the OK button, and you should have a connection.

To key database commands, go to the Connections view in the bottom left section. Select the active connection, click the right mouse button, and select New SQL Editor in the pop-up menu. SQLExplorer will then open the SQL editor in the middle of the perspective. The SQL Editor has three icons and the name of the database the SQL editor is associated with. The icons are a running man, a folder, and an eraser. The running man runs the SQL, the folder lets you search for an open a .sql file, and the eraser clears any SQL statements that may be in the editor.

The results of SQL execution is shown in tabbed views in the SQL Results. For instance, if you run a select statement two times, you'd have two tabs, labeled "1" and "2," in the SQL Results view. Note that the SQL Result view shows the retrieved rows with the column name as buttons. A click of the button will sort the rows by that column.

As you'd expect, the contents of an SQL Editor can be saved. Once SQLExplorer is installed, the default editor for files with the .sql suffix will be opened in the SQL Editor.

The SQL History view that appears in the right-hand panel (along with Database Structure view and Connection info) can be quite handy because you can use it to re-execute a statement. To do that, select a statement in the history, click the right mouse button, and select Open in Editor. Then click the running man icon.

The Database Structure View also has a number of convenient features. Besides listing all the tables in your database, you can perform the following:

Open a table-edit GUI. Generate an SQL select statement for that table and place it in an SQL Editor. Create a table script (which didn't work on my Postgresql database).

When you select a table, the Database Structure View will also list the columns, indexes, primary keys, foreign keys, and row count for that table.

The Edit Table menu option could be quite handy, but it was not yet implemented in the version of SQLExplorer that I have been using. But you can see how it will work by selecting a table, clicking the right mouse button, and selecting Edit Table Data from the context menu. The Editing panel will pop up with a list of a set of rows from the table. To limit the rows displayed, you can key a where clause. To modify a data element, simply click on that item. The entry will then turn into an modifiable input field. After you change the data, you'll finally get the "Error updating: This method is not yet implemented" message. I suppose they're hoping that a user of SQLExplorer will take it upon himself to implement that feature.

Review
SQLExplorer is a fork of the JFaceDBC project. From what I understand, other forks have turned into commercial products, whereas SQLExplorer is LGPL. SQLExplorer works with Eclipse 3.0.

I tested SQLExplorer 2.2.2 7 on Eclipse 3.0. One problem I have with SQLExplorer is that it doesn't have integrated Eclipse help. A little bit of help would have gone a long way, especially since I had problems figuring out how where to key the SQL statements. I kind of expected a console or something for me to use to key the statements, and I had to stumble on the use of the SQL Editor. But once you understand that the SQL statement are keyed and executed from the SQL Editor -- and that the editor can be launched from an existing file (with a .sql suffix), the New SQL Editor context menu option in the Connections view, from the SQL History view, or from a context pop-up menu of a table selected in the Database Structure View -- you're ready to dance with your database.

I'm giving SQLExplorer a rating of 8.5 (out of 10). SQLExplorer is now a standard plug-in for my Eclipse workspaces. If it had Eclipse help and the completed implementation of features that are already being shipped, I'd give SQLExplorer a 9 or better.

本文地址:http://com.8s8s.com/it/it11403.htm