This is a feature of JBuilder Professional and Enterprise.
To open the Use Data Module Wizard, choose Wizards|Use Data Module. This option is available when a designable node is selected. Data modules must be compiled before they can be recognized by this wizard. The Use Data Module wizard displays a choice of DataModules
in the current project or lets you browse elsewhere. It also lets you pick the Java variable name to use for it.
Data modules simplify data access development in your applications. Data modules offer you a centralized container for all your data access components. This enables you to modularize your code and separate the database access logic and business rules in your applications from the user interface logic in the application. You can also maintain control over the use of the data module by delivering only the .class files to application developers.
The Use Data Module wizard enables you to select an existing data module to add to your project. A data module is a specialized container for data access components. Once you define your DataSet
components and their corresponding Column
components in a data module, all frames that use the module have consistent access to the data sets and columns without requiring you to recreate them on every frame each time you need them. Data modules do not need to reside in the same directory or package as your project. They can be stored in a location for shared use among developers and applications.
For a tutorial and discussion of data modules, see "Using data modules to simplify data access" in Database Application Developer's Guide.
DataModule
class in this list, use Project|Project Properties to add the package or archive to your libraries. Browse to the location of the class files generated when the data module was saved and compiled. Select the data module class.
Frame
subclass in your application, select this option.
DataModule
class, select this option.
Based on the choices shown in the dialog above, the following code will be added to the jbInit()
method of the Frame file. Note that Share (Static) Instance of Data Module is selected:
dataModule12 = com.borland.samples.dx.datamodule.DataModule1.getDataModule();
If Create New Instance Of DataModule is selected, the following code will be added to the jbInit()
method of the Frame file:
dataModule12 = new com.borland.samples.dx.datamodule.DataModule1();
If The Application Sets The Instance By Calling SetModule() is selected, a setModule()
method is added to the class being edited.