Accessing data
The first step in creating a data application is to access information stored in the data source and create a copy so that the data can be manipulated locally by your application.
In JBuilder, a subset of data is extracted from the data source into a JBuilder StorageDataSet subclass. The StorageDataSet subclass you use depends on the way in which you obtain the information. For example, when using queries (with or without parameters), use the QueryDataSet and for stored procedures, use the ProcedureDataSet. For these types of DataSet components, the data source is a SQL server database so you also need a Database component to handle the connection to the server.
When reading data from a text file, use the TableDataSet component but since a text file is not a SQL server, you do not need a Database component.
The following diagram describes the different ways to obtain and store data into a JBuilder component that is appropriate based on the data source:
This chapter includes basic tutorials on accessing data, as well as issues and features that affect or control accessing data.
- Connecting to a database using JDBC describes the steps required to connect to a SQL server database through JDBC and the JDBC-ODBC bridge. All data access applications which use queries or stored procedures to access data require this step.
- Querying a database steps through creating the local copy of the data by executing a query and storing its result set of the query in a QueryDataSet component.
- Using parameterized queries to obtain data from your database outlines the steps required when adding parameters to your query statement.
- Encapsulating your data model for reuse explores JBuilder's data module capability and how you can create your data model once, then reuse it when needed.
- Working with columns explains how to work with Column components in the JBuilder visual design tools and in code. This topic discusses metadata and other Column properties, and how you control what properties persist.
- Importing data from a text file describes how to import data from a text file into the TableDataSet component. This topic discusses how to programmatically add Column components and read in data such as date and timestamp data for which there are no standards.