This document describes the support for database connections node in the Services Tab. Some of the main functionalities supported are
The database connections root node in the Services Tab provides the view for the user to interact with the IDE for database support. The database connections node could provides predefined connections to sample databases in the bundled database server. When the IDE starts these predefined connections would show up in the Services Tab. The information about these predefined connections will be kept in the IDE user directory. User can edit these files and place their data connections info by hand using the defined format.
The following figure shows how the database connections node appears in the Services Tab
![]() |
By right clicking on the Database Connections node and choosing Add Connection from the pop-up menu. User will be provided with the Add Connection dialog box in which user can supply information about the connection, such as host name, database name, user name, etc
![]() |
By right clicking on the Database Connections node to be removed and choosing Remove Connection from the pop-up menu. A confirmation dialog pops up to confirm the deletion
![]() |
By right clicking on the Database Connection node that is being modified and choosing Modify Database Connection from the pop-up menu, user gets to the modify connection node. By default only the schema associated with the current user is displayed in the connection node. Using Modify Connection action user could view other schemas also.
![]() |
When a connection is added to the project, project keeps reference to the connection in the project. But the actual connection info is maintained by the Connection Manager in the Connection Explorer view. So when the project is checked in to the CVS and checked out by another user, the other user need to add the corresponding connections to his/her IDE environment. This can be achieved by exporting and later importing the connections. The user has the option to provide the user name and password to the other user.
![]() |
When the other user gets the exported Connections XML file, now he/she can import the Connections in to the IDE Connections nodes using the Import Connections dialog. If the user name and password is not exported, then user need to modify the connection using Modify Connection dialog to specify the username and password.
![]() |
While adding connections to the Connections Explorer node, user also must be able to add the corresponding JDBC driver jars to the IDE. This need to be done for two reasons.
User can add the JDBC driver by right clicking on the connection root node and selecting the Edit JDBC Driver menu item. In the resulting dialog user could add the driver information.
![]() |
Right click on the "Drivers" node and select "Remove JDBC driver". All the meta-data info related to this particular driver stored in the user dir will be removed.
User might want to change the jars associated with a particular JDBC driver Info. This is done by providing a menu item called Modify JDBC Driver in the "JDBC drivers" node
After connecting to the database via the connection, user has the option to explore the tables and table views in the database. Also via the property sheet user get to see some of the metadata of the Table and its columns
![]() |
Also user get to see the contents of the table before adding the table to a component such as table component, by right clicking and selecting view data from the View Data Menu item or double clicking the table node
The data view also gives option to edit the query to customize the view of the data from the table. After modifying the query Run Query fetches the number of rows as specified in the data view.
![]() |
<TBD>
<TBD>
<TBD>
The Database Connections Root Node is added to the Services Tab, via the contract published by Services Tab. So the root node should be added via the layer file as
<folder name="UI">
<folder name="ServicesTab">
<file name="org-netbeans-modules-db-nodes-DatabaseConnectionsRootNode.instance" />
</folder>
</folder>
| add_connection_dialog.png | ![]() |
4352 bytes |
| db_add_jdbc_driver.png | ![]() |
26484 bytes |
| db_data_view.png | ![]() |
33713 bytes |
| db_explorer_view.jpg | ![]() |
49720 bytes |
| db_explorer_view.png | ![]() |
25950 bytes |
| delete_connection_dialog.png | ![]() |
4419 bytes |
| export_db_info_dialog.png | ![]() |
31753 bytes |
| import_db_info_dialog.png | ![]() |
28661 bytes |
| modify_connection_dialog.png | ![]() |
3381 bytes |
| table_column_properties.png | ![]() |
29320 bytes |