A SimpleText database is a JDBC-based, flat file database. Its level of complexity is comparable to the Text ODBC driver included with Windows.

 

The included SimpleText JDBC driver has been modified from the source code distributed by Thought Inc. The file format is comma-delimited and editable in a text editor. It does not implement any form of login or security.

 

SimpleText database files include two files - a data file and a binary file. The data file is a text file of values separated by commas. The text file consists of a header line and zero or more lines of delimited text. With the exception of the header line, if present, each line of text in the file constitutes one row of data in the database. The driver interprets any header line as column names, not as data. The header line starts with the data file’s extension, .SDF, followed by the column names with commas between them. You can also define the column’s data type in the header line. You can use the character # to define a column as Integer type, and the character @ to define a column as Binary type. If you do not use either of these characters, the driver interprets the data type as VARCHAR.  

 

The data file extension is .SDF and the binary file extension is .SBF. The binary file is a 0 byte file with the same name as the data file if you do not define VARBINARY type data in the data file.  

 

SimpleText database specifications:

 

Tables are limited to a maximum of 80 columns.

Table names are limited to 40 characters.

Column names are limited to 18 characters.

VARCHAR type data length is limited to 5120 characters.

INTEGER type data length is limited to 9 digits

VARBINARY type data length is limited to 1048576 bytes.

A text file can only be opened for a single user; multiple users are not supported.

Character strings in a delimited text line can be enclosed in single quotation marks (‘’), but it is not a strict requirement.

 

The following steps will guide you through setting up a JDBC data source link to a flat file using the SimpleText Driver, and using that file as a table in PEERNET Reports Designer.

 

Note that the sample database files SampleData.SDF and SampleData.SBF are used in the following procedure; they can be located in the \userguide\samples folder under the PEERNET Reports installation directory.

 

simple_text_database

 

1.Launch PEERNET Reports Designer and open or create the project in which you want to use this data source.

 

Here, the sample project file Chapter06_JDBC_SimpleText.pnj is opened.

 

2.To add your text delimited file as a table in the project, double-click the Tables item to display the Link Table dialog box.

 

3.The first step of the Link Table wizard presents a choice of three types of data sources. Enable the JDBC Database option, and click Next.

 

link_table_dialog

 

4.The next page lists the available JDBC database drivers. Select SimpleText JDBC Driver from the Type drop-down list.

 

link_table_jdbc_simple_text_database_dialog_1

 

5.Driver and Protocol are predefined. Type or copy the folder path where the .SDF and .SBF files are located into the URI field. This database does not require a User Name or a Password, so these fields can be left blank. Click Next.  

 

6.Select the table SampleData and click the Link button to add it to your project file. Click Close to return to the application window.

 

link_table_jdbc_simple_text_database_dialog_2

 

7.Click the icon_expand to expand the Tables item and view the newly added table in the list. Double-click this table to view its data.

 

8.The Design View of the table lists the columns in the table, along with the data type of the data in each column.

 

link_table_jdbc_simple_text_database_design_view

 

9.The Datasheet View of the table shows the actual data in this data source.

 

link_table_microsoft_access_datasheet_view

 

10.The table is now ready to be used in a report, label, or query.