ResourceReferenceBindingUseDatabaseUI

Use Database UI Specification

The motivation is described in Resource Reference Binding document.
Briefly, we would like a user to provide a data source reference name in addition to a data source itself. This reference name is used in the source code and in standard deployment descriptor (DD). The reference name is bound to a data source in a server-specific DD. For this purpose, we introduce a new dialog allowing to select the reference name. User may also create a new reference name.

Use Case

User wants to work with database.

Basic Flow

  1. User executes "Use Database" action.
  2. User selects one from the existing reference names. (A2)
  3. User hits 'OK' button. The reference name is used in the generated Java code and in the standard DD.
+-----------------------------------------------------------------------------+
| Choose Database                                                             |
+-----------------------------------------------------------------------------+
|                                                                             |
| Reference:     |_SampleReference'''[<JDBCConnectionURL>]'''_|_v_| | Add...| |
|                                                                             |
| + Service Locator Strategy------------------------------------------------+ |
| |   (o) Generate Inline Lookup Code                                       | |
| |   ( ) Existing Class |'''_''''''_''''''_''''''_''''''_''''''_''''''_'''____| |Browse| | |
| +-------------------------------------------------------------------------+ |
|                                                                             |
|                                                  | OK | | Cancel | | Help | |
+-----------------------------------------------------------------------------+

Alternative Flow A2

  • A2. If there is no suitable reference name, user may create a new one.
  • A2.1. User hits 'Add...' button besides the 'Reference' combobox. The 'Add Data Source Reference' dialog pops up.
  • A2.2. User provides a new unique reference name.
  • A2.3. User selects one from the existing data sources or creates a new one (user may require to copy the server data source to the project).
  • A2.4. User hits 'OK' button. The flow returns to the step 2, the created reference is selected.
+----------------------------------------------------------------------+
| Add Data Source Reference                                                        |
+----------------------------------------------------------------------+
|                                                                      |
| Reference Name:           |'''_''''''_''''''_''''''_''''''_''''''_'''|           |
|                                                                      |
| (o) Project Data Sources: |_jdbc/SampleProjectDS'''_'''|_v_| | Add...| |
|                                                                      |
| ( ) Server Data Sources:  |_jdbc/SampleServerDS'''_'''_|_v_|           |
|                                                                      |
|        [ ] Copy Selected Data Source To Project                      |
|                                                                      |
|                                           | OK | | Cancel | | Help | |
+----------------------------------------------------------------------+


The rest of the flow is left as it currently is...

If there is no suitable data source...

http://wiki.netbeans.org/wiki/attach/ResourceReferenceBindingUseDatabaseUI/new_ds_ResourceReferenceBindingUseDatabaseUI.png

If there is no suitable database connection...

http://wiki.netbeans.org/wiki/attach/ResourceReferenceBindingUseDatabaseUI/new_conn_ResourceReferenceBindingUseDatabaseUI.png

If there is no suitable database driver...

http://wiki.netbeans.org/wiki/attach/ResourceReferenceBindingUseDatabaseUI/new_driver_ResourceReferenceBindingUseDatabaseUI.png

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo