Altova DatabaseSpy 2023 Enterprise Edition

Adding Data Sources

Home Prev Top Next

Working with any kind of database in DatabaseSpy requires that you add a data source to the project. All data sources added to the project appear in the Data Sources folder in the Project window.

To add a data source to your project:

Do one of the following:

 

On the File menu, click Create a Database Connection.

Press the keyboard shortcut Ctrl+Q.

Click the Connect to a database Connect to a database (Ctrl+Q) toolbar button.

In the Project window, right-click the Data Sources folder and select Add a New Data Source... from the context menu.

 

From this point onwards, follow the connectivity instructions applicable to the database kind or to the interface you want to connect (ADO, ADO.NET, ODBC, JDBC, or native), see Connecting to a Database. For database connection examples applicable to various database kinds, see Database Connection Examples.

 

Data source options

When you right-click a data source name in the Project window, you can choose from several options depending on the current state (connected or disconnected) of the data source and whether or not the data source is a global resource. The corresponding keyboard shortcuts are shown to the right of the options if they are available.

 

Connect


Connects to a data source if it is disconnected.

Disconnect


Disconnects from a data source if it is connected.

Remove

Del

Removes a data source from the project.

Rename

F2

Renames a data source. Note that only disconnected data sources can be renamed.

Convert to Global Resource


Converts the data source to an Altova Global Resource (see Altova Global Resources) and adds a database alias with the data source name to the GlobalResources.xml definition file. If an alias with that name already exists, a warning message will be displayed and the operation will fail.

Copy Global Resource into Project


Generates a copy of the global resource and adds it to the project as stand-alone data source. You will have to specify a name for the new data source. The original global resource remains in the project.

Edit Global Resource...


Opens the Global Resource dialog box where you can edit the configuration of the database alias.

To copy a global resource into a project:

1.In the Project window, right-click a data source that has been added to the project as global resource and select Copy Global Resource into Project from the context menu.

2.Enter a name in the Set a Data Source Name dialog and click OK.

3.Optionally, remove the global resource from the project.

To remove a data source from a project:

Select the data source you want to remove and do one of the following:

 

Right-click the data source and choose Remove from the context menu.

Press Delete.

 

If the data source is connected, DatabaseSpy displays a warning that removing the data source will close the connection.

 

Renaming data sources

Data sources in projects can be renamed either in the Properties window or via the context menu directly in the Project window.

 

Note:You can only rename data sources that are currently disconnected. Both the Rename command in the context menu and the title bar in the Properties window are grayed out for connected data sources.

To rename a data source in a project:

1.Make sure that the data source is disconnected.

2.Select the data source you want to rename and do one of the following:

 

In the Properties window, double-click the title bar.

In the Project window, right-click the data source and select Rename from the context menu.

Press F2.

 

3.Enter the new name and press Enter.

4.Save the project.

© 2017-2023 Altova GmbH