This is a feature of JBuilder Professional and Enterprise.
The JDBC Explorer is a hierarchical database browser that also allows you to edit data.
The JDBC Explorer presents JDBC-based meta-database information in a two-paned window. The left pane contains a tree that hierarchically displays a set of databases and its associated tables, views, stored procedures, and metadata. The right pane is a multi-page display of descriptive information for each node of the tree. In certain cases, you can edit data in the right pane as well.
To display the JDBC Explorer, select Tools|JDBC Explorer from the JBuilder menu.
Through a persistent connection to a database, the JDBC Explorer enables you to:
Create tables in an existing database.
Create, view, and edit data in existing tables.
Enter and execute SQL statements to query a database.
The JDBC Explorer window contains a menu, a toolbar, a status label, and two panes of database information.
An expand glyph beside an object in the left pane indicates that the object contains other objects below it. To see those objects, click the expand glyph. When an object is expanded to show its child objects, the expand glyph becomes a contract glyph. To hide child objects, click the contract glyph.
The following color-coded symbols appear to the left of URLs in the left pane:
![]() |
The highlighted database is open. You can view objects in the database. |
![]() |
The highlighted database is a new URL. Click the Apply button to apply the connection parameters, click the Cancel button to abandon a connection. |
![]() |
The highlighted database URL has been modified or edited. Click the Apply button to commit the changes, click the Cancel button to abandon modifications. |
![]() |
The highlighted database is closed. To open the database, click the expand glyph beside it. |
The right pane contains tabbed pages that display the contents of objects highlighted in the left pane. The tabbed pages in the right pane vary depending on the type of object highlighted in the left pane. For example, when a database alias is highlighted in the left pane, the right pane displays a Definition page that contains the database URL, Driver, UserName, and other parameters, or properties. Bolded parameter names indicate a parameter that cannot be modified. All other parameters that appear in the right pane can be edited there. The following tabbed pages may appear in the right hand pane:
The database objects that appear on the left side are dependent on the type of database driver selected for the URL. Some of the database drivers are based on Java Database Connectivity (JDBC). JDBC is an all-Java, thus cross-platform, API.
The left pane contains the categories of database objects supported by the selected driver. These may include:
The JDBC connection URL is the JDBC method for specifying the location of a JDBC data provider (i.e., SQL server).
You can use the JDBC Explorer to view, create, and modify database URLs. The following steps assume the URL is closed, and lists each task, briefly describing the steps needed to accomplish it:
View URL
Create URL
Modify URL
Delete URL
Note: If you're creating a new ODBC URL, and you are running under Windows NT, you must define its ODBC Data Source though the Windows Control Panel before you can connect to that database.
When a table is selected in the left pane, you can enter and edit records on the Data page if the table permits write access, and if Request Live Queries is checked in the View|Options dialog box. Refer to the Using the Explorer to view and edit table data topic for more information on entering and editing data in tables. The Data page displays a grid populated with the data from the selected table. A navigation tool is displayed across the top of the grid for navigation and data modification.
Click the expand glyph beside a table in the left pane to display the child objects for the table. Child objects for the table object include:
Click the expand glyph to the left of the Columns object in the left pane to display the columns (also known as fields) contained in the table. The Summary page in the right pane lists the columns, their data type, size, and other information.
Indexes
Click the expand glyph to the left of the Indexes object in the left pane to display the names of the indexes, which are different ways to sort data for viewing. Select a specific index to view information about how the index is defined on the Definition page in the right pane.
Primary Key
Click the expand glyph to the left of the Primary Key object in the left pane to display the primary key, a column or set of columns that requires a unique value. Select the primary key to view a Summary of its information in the right pane.
Foreign Keys
Click the expand glyph to the left of the Foreign Keys object in the left pane to display the foreign keys, which are references to key fields in other tables. Select a foreign key to view its Definition in the right pane.
Click the expand glyph beside the Views object to display the list of custom views for this table. A custom view is a predefined query that returns a subset of data.
To create a custom view of a database table or query in SQL, enter an SQL statement on the Enter SQL page, such as
create view CaliforniaEmployees as select * from employee where state = "CA"
When you execute the SQL statement, a view will be created so you can easily see all California employees whenever you wish.
System tables get created with the database; they are not created by the user. Most SQL servers are self-descriptive; that is, they store information about the database in system tables. For example, there might be one system table that has as its contents the names of all the tables in the database, another that describes all indexes in the database, and so on.
You can use the JDBC Explorer to browse database server-specific schema objects, including stored procedure definitions, source (for some drivers), and parameters. With a stored procedure, one or more SQL statements are encapsulated in a single location on your server and can be run as a batch. For information on running stored procedures, see the Obtaining data through stored procedures topic in Database Application Developer's Guide.
In the Enter SQL page, you can enter a procedure name or server-specific syntax for procedure calls. When a server allows a separate syntax for procedure calls, you can enter that syntax instead of an existing stored procedure or JDBC procedure escape sequence. For example, server-specific syntax may look like this, where the ? character is a placeholder for a parameter:
execute procedure PROCEDURENAME ?,?,?
To browse stored procedures and their parameters,
Click the expand glyph to the left of the Procedures object in the left pane to view the procedures defined for the selected database URL.
Select the Definition tab to view the stored procedure definition.
Click the Text tab to view the source for the selected stored procedure.
Click the expand glyph to the left of the Parameters object in the left pane to view the Definition of the stored procedure's parameters in the right pane.
The pane on the right side contains tabbed pages that change depending on which type of database object is selected. The options include:
The Definition page displays the parameters, or properties, of the object highlighted in the left pane.
The Enter SQL page displays a window in which you can enter SQL statements, or specify and execute an existing .SQL file. The main part of the screen is an edit box where you can enter SQL statements. To the right of the edit box are four buttons, the Execute button, the Next button, the Previous button, and the Load SQL button. When an SQL SELECT statement is executed, the results of the query are displayed in an editable table, which is located below the edit box. This screen may need to be resized to view all its components. The page looks like this:
To query a database using SQL:
You can copy SQL statements from text files, a Help window, or other applications and paste them into the edit box. Some SQL servers require that the table name be entered in quotation marks, some do not require this.
Select the Data page to display the data in a selected table, view, or synonym. You can enter and edit records in a table on the Data page if the table permits write access, and if the Request Live Queries box of the Query page of the View|Options menu is checked. The Data page displays a table populated with the data from the selected table. A navigation tool is displayed across the top of the table for navigation and data modification. The Data page looks like this:
Select the Text page to view the source code for stored procedures.
You can use the JDBC Explorer to view, edit, insert, and delete data in tables. The following list of tasks briefly describes the steps needed to accomplish each.
Edits only take effect when they are applied. To apply edits and make changes permanent:
The Summary page displays the objects contained within the Table or Procedure highlighted in the left pane. Double-click an item in the Summary list to display its Definition.
Although you will work primarily with database URLs and data in the left and right pane of the Explorer, understanding the JDBC environment is essential to taking full advantage of its benefits.
These commands appear on the File menu. Most of these commands are also available from the context menu that appears when you right-click an object in the left pane of the JDBC Explorer.
New | Opens the New URL dialog. See New URL dialog for a description of its options. |
Open | Opens the highlighted URL. You will be prompted for a user name and/or password.
If you are using the InterBase tables used in some of the database tutorials, the password is SYSDBA and the password is masterkey. If you are using the sample JDataStore tables, enter your user name. Leave the password blank. |
Close | Closes the highlighted URL. |
Create Table... | Opens the Create Table dialog box which enables you to create a database table and define its columns visually. |
Apply | Commits modifications made on the Definition page of a selected URL to the database. The Apply option will be available when you have added or edited a URL. |
Cancel | Abandons modifications made on the Definition page of a selected URL. |
Delete | Deletes the highlighted URL from the JDBC Explorer view. |
Exit | Exits the JDBC Explorer. |
The following options are available from the View menu:
Toolbar | If checked, the toolbar is displayed near the top of the Database Explorer. The toolbar offers a few convenient icons that duplicate the functionality of menu commands such as Open, Close, Delete, Apply, and Cancel. |
Statusbar | If checked, a status bar appears at the bottom of the Database Explorer window. It states how many items are found in the object highlighted in the left pane. |
Blob Explorer | The Blob Explorer dialog is used to display the contents of memo or graphics data in a blob (binary large object) field. For a description of the Blob Explorer, see Blob Explorer below. |
Refresh | If enabled for the currently selected database, Refresh retrieves server information and redraws the display of the database and its children. |
Options | Opens the Options dialog, which contains 2 pages: Login and Query. See JDBC Explorer options for a description of the options. |
The Blob Explorer dialog is used to display the contents of memo or graphics data in a blob (binary large object) field. To open the Blob Explorer, select View|Blob Explorer. While you can open the Blob Explorer at any time, it is only meaningful when you are browsing or editing blob data in a table.
If the field is an image field, the Blob Explorer attempts to display the graphic. If the field is a text field, the Blob Explorer attempts to display the blob text.
For example, in the sample database used in the Database Application Developer's Guide, the sample database PROJECT contains a field, PROJ_DESC, of type BLOB SUB_TYPE 1, a text field.
To use the Blob Explorer on this column,
The entire text of the field appears in the Blob Explorer window.
The following options are available from the Help menu:
Contents | Displays the JBuilder JDBC Explorer Help Viewer window. |
About | Displays JDBC Explorer version and copyright information. |
The JDBC Explorer toolbar contains the following buttons for executing commands:
JDBC Explorer toolbar
From left to right, here is what the buttons do:
Button | Command |
---|---|
Open | Opens a selected URL. You will be prompted for a user name and password, then a connection to the URL will be established. |
Close | Closes a selected URL by terminating the connection to the server. |
Delete | Deletes a selected URL. When the URL is deleted, it will not appear in the list of URLs available to the JDBC Explorer. To see the URL again, select File|New to add the URL to the JDBC Explorer window. |
Cancel | Abandons modifications made on the Definition page of a selected URL. |
Apply | Commits modifications made on the Definition page of a selected URL to the database. The Apply button will be available when you have edited or added a URL. |
Type the name of the new table in the Table Name field.
To modify the SQL statement manually, click the SQL button. The SQL field at the bottom becomes an active editor.