IntelliJ IDEA 2016.3 Help

Database

File | Settings | Tools | Database for Windows and Linux
IntelliJ IDEA | Preferences | Tools | Database for OS X
From the database, Hibernate and JPA consoles: /help/img/idea/2016.3/settings.png
From the table editor: /help/img/idea/2016.3/IconDBToolbarMenu.png | Settings


The pages in the Database section contain the settings related to working with databases and SQL.

Console

The settings in this section relate to showing various information in database consoles.

ItemDescription
Show query results in new tabYou can select to view query results on individual tabs, or on one and the same tab.

If the check box is selected, a new tab with the query result will open each time you run a query (SELECT). In this way, you can keep the results of all the queries that you have run.

/help/img/idea/2016.3/ShowResultsInNewTabON.png

If this check box is not selected, the same tab is used to show your query results. When you run a query, the information on the tab is updated to show the result, and a new tab doesn't open.

/help/img/idea/2016.3/ShowResultsInNewTabOFF.png

In this case, when you get the result that you want to keep, you can pin the tab to the tool window (/help/img/idea/2016.3/pin.png on the toolbar or Pin Tab in the context menu for the tab).

/help/img/idea/2016.3/ShowResultsInNewTabOFFPinTab.png
Show error notifications in editorIf this check box is not selected, the information about the errors is shown only in the output pane. If, in addition, you want the error notification bar to appear in the input pane, select the check box.

The error notification bar may be particularly useful when running sequences of SQL statements. If an error occurs in such cases, the error notification bar lets you select how to react.

/help/img/idea/2016.3/DBConsoleErrorNotificationBar.png

For more information, see Using the error notification bar.

Always review parameters before executionWhen you run a statement with parameters, IntelliJ IDEA memorizes the parameter values. Each next time you execute the statement:
  • If this option is on, IntelliJ IDEA shows you the last used parameter values so that you can change them before actually running the statement.
  • If this option is off, IntelliJ IDEA executes the statement right away without showing you the parameter values.

Execute in Console

This section contains the options for the Execute command.

ItemDescription
When inside a statement executeIf the cursor is inside a statement, the following options are available:
  • Ask what to execute. A list of statements that you can run is shown and you can select the statement or statements.
    /help/img/idea/2016.3/DBSelectStatementToExecute.png
  • Smallest statement. The smallest of the possible statements is executed. For example, when the cursor is inside a subquery, the subquery is executed.
  • Largest statement. The largest possible statement is executed. For example, when the cursor is inside a subquery, an outer statement is executed.
  • Largest statement or batch. For Transact-SQL (SQL Server and Sybase), the current batch of statements is executed. For all other dialects - the same as the previous option.
  • Whole script. All the statements are executed.
otherwise executeIf the cursor is outside of a statement, e.g. on a blank line or within a comment, the following options are available:
  • Nothing. None of the statements is executed.
  • Whole script. All the statements are executed.
  • Everything below caret. All the statements after the cursor position are executed.
for selection executeIf something is currently selected, the following options are available:
  • Exactly as one statement. Exactly what is selected is executed as a single statement.
  • Exactly as statements. Exactly what is selected is executed. If the selection contains more than one statement, the statements are executed as separate statements.
  • Smart expand to script. If there is at least one statement border within the selection, the selection is expanded to form a sequence of valid statements. This sequence is then executed.

    Otherwise, precisely what is selected is executed.

Quick Documentation

ItemDescription
Allow database access Let IntelliJ IDEA access the database when generating quick documentation. For example, for a table:
  • If this option is on, first rows are shown, and the table definition (CREATE TABLE) is retrieved from the database.
  • Otherwise, the data are not shown, and an auto-generated table definition is presented.

Generally, when the option is on, you get more info but it takes more time to get the info.

Number of preview rows The number of rows to be shown for a table in the quick documentation view.

DDL editor

ItemDescription
Show confirmation on close When trying to close the Create / Modify Table dialog by clicking Cancel or pressing Escape:
  • If this option is on, you are asked for a confirmation.
  • Otherwise, the dialog closes right away.

See Also

Last modified: 7 December 2016