Managing data sources
Data source is a location of data for your application. In IntelliJ IDEA, you can define the following data sources:
Database data source: operational databases that contain data (see Connecting to a database).
Data Definition Language (DDL) files: SQL files that contain data definition language statements (see Add a DDL data source).
Create a data source
Create a DB data source from database files
If database files are in your project folder, open the Project tool window. Otherwise, open your file manager.
Open the Database tool window ( ).
Select the files that you want to use as data sources and drag them to the Database tool window. A separate data source is created for each file.
If you do not have the necessary database driver files, download them. Click on the toolbar of the Database tool window. Alternatively, select Properties from the context menu.
In the Data Sources and Drivers window, click the Download link.
To ensure that the connection to the data source is successful, click Test Connection, and click OK.
Create a DDL data source
Open the Database tool window ( ).
Click the Data Source Properties icon () on the toolbar, and select DDL Data Source.
Specify the data source name.
In the DDL Files form, click the Add icon () and select necessary SQL files.
Customizing data sources
Configure data source settings
In the Database tool window ( ), select a data source that you want to change.
Click the Data Source Properties icon () on the toolbar (or press Shift+Enter).
In the Data Sources and Drivers window, edit the data source properties. For more information about data source properties, see Data source settings and DDL data source settings.
Group data sources
If you have a number of different databases, you can group their data sources in the Database tool window ( ).
To group data sources, select the necessary data source, press F6, or select Move to Group from the context menu.
To create a new group, drag one data source onto the other. If you want to place the data source into an existing group, drag it to the existing group node.
To remove a data source from the group, move the data source to the root list.
Remove data sources
To remove a data source, in the Database tool window ( ), press Delete. Alternatively, you can select Remove from the context menu, or click .
Also, to remove a data source, you can use the Data Sources and Drivers window ( ). In the Data Sources and Drivers window, select the data source and press Delete. Alternatively, you can click on the toolbar, or select Remove from the context menu.