IntelliJ IDEA 11.1 Web Help

8.0+
Some features described here are available in Ultimate edition only.

Configuring a involves the following general activities:

To specify general DB data source settings
  1. Open the Data Source Properties dialog box by doing one of the following:
    • Start creating a new DB data source.
    • In the Data Sources tool window, select the desired data source and choose Data Source Properties in the context menu.
  2. Specify the name of the data source.
  3. Specify the scope in which the data source will be available in the Data Source Level drop-down list.
    • To enable access to the data source only from the current project, select Project.
    • To enable access to the data source from any project in your workspace, select Global.
To appoint a JDBC driver to use
  1. In the JDBC Driver Files drop-down list on the Database tab of the Data Source Properties dialog box, specify the library or archive with the class that implements the JDBC driver of the required type. Do one of the following:
    • If you already have a relevant library or archive downloaded, click the Browse button browseButton and select the library or archive in the Choose JDBC Driver Files dialog box that opens.
    • To have IntelliJ IDEA download the JDBC driver sources, select the required JDBC driver from the drop-down list. The read-only list below displays the relevant archive detected among the specified sources. Click the link to have IntelliJ IDEA start downloading the detected archive.

    Note

    IntelliJ IDEA analyzes the archives and libraries and detects classes that implement drivers. Detected classes are available in the JDBC Driver Class drop-down list.

  2. From the JDBC Driver Class drop-down list, select the relevant driver implementation class.
To specify the settings to access the target database
  1. In the Database URL text box on the Database tab of the Data Source Properties dialog box, type the URL address of the database.
  2. In the Username and Password text boxes, type your database access credentials.
  3. To check that the specified settings ensure successful connection to the database, click the Test Connection button.

    Warning

    The database server should be running.

To download tables
  • Click the Refresh Tables button refresh.

    Tip

    If you do not need to access the entire database, specify the set of accessible tables.

To get access to specific tables
  1. Open the Schemas & Tables tab of the Data Source Properties dialog box.
  2. Do one of the following:
    • If the target database supports schemas, select the Scan for Tables check box next to the relevant schemas.

      Tip

      To have IntelliJ IDEA resolve the names of the tables accessed through a schema so you do not need to write their fully qualified names, select the Make Default check box next to the relevant schema.

    • Specify the pattern of table names to retrieve the matching tables only.
To configure the behaviour of the Database Console
  1. Open the Console tab of the Data Source Properties dialog box.
  2. Specify the SQL dialect to be used by default. Based on this setting, IntelliJ IDEA provides you with code assistance in the Database Console tool window.
  3. Specify the run configuration to launch the Database Console tool window.
To view and edit advanced connection properties
  • In the Advanced tab of the Data Source Properties dialog box, update the contents of the Value text box next to the names of the relevant connection properties.

See Also

Language and Framework-Specific Guidelines:

Reference:

Web Resources: