The Import Data from a JDBC Data Source
page allows you to define a database connection configuration for
nodes and links and then load your data.
This section uses the Arizona example.
To create a database connection
configuration:
-
Click New Configuration to name a new database connection configuration.
-
Name it Arizona.
-
Specify a URL to connect to the database.The Universal Resource Locator (URL) can indicate a connection to a remote database or a path to a local file. It specifies the driver to use and the path to the file or database.The default driver is Microsoft® Excel® ; this is correct for the Arizona data. The path is relative to the Designer run file location.
-
Click the Ellipsis button.
-
Browse to select the data file
ArizonaData.xls
.Note that the Designer replaces only the file name in the URL.
-
-
Specify your user name and password, if these security items are required.If your data is in a local file (as the Arizona data is), you do not have to enter a user name and password. If your data is in a database, the Database Administrator can provide the information.
-
Specify an SQL query string for nodes (in the Nodes tab) and an SQL query string for links (in the Links tab).If the database is a Microsoft® Excel® file, you specify the name of the sheet instead of a table name. The default sheet names in Excel® are just Sheet1, Sheet2, and so on.The default query shown selects all columns from an Excel® sheet called Nodes, as follows:
select * from [Nodes$]
In the example supplied asArizonaData.xls
, suitable queries are as follows:For node data:select T1.*, T2.Availability, T2.Throughput from [Sheet1$] as T1, [Sheet2$] as
T2 where T1.City = T2.City
For link data:select * from [Sheet3$]
-
Click Execute Query to execute the SQL query.
-
Click Save Configuration to store the database connection configuration for future use.The database connection configuration is stored in the project file.Note that the Rogue Wave® predefined connections cannot be saved. In the case of a predefined connection, the Save Configuration button is disabled.After executing an SQL query, you see the data in tabular form in the Preview pane, see the following figure for node data.Retrieving Arizona node data
-
Check that the data retrieved is as required.See also the following figure for link data.Retrieving Arizona link data
-
Click Next to proceed.