IntelliJ IDEA 12.1.0 Web Help

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

Database tool window | < any node >|   runJdbcConsole.png Open Database Console


The Database Console tool window opens when you select a DB data source in the Database tool window and then select runJdbcConsole Console in the context menu. For each data source, a separate dedicated console is opened.

Use the Database console to view, query, and modify the information in the data sources configured in your workspace.

The Database console consists of the following panes:

Tip

The usual editor techniques are available in the Database console.

Input pane

The Input pane opens as an editor tab. Use this pane to type, edit, and run SQL commands on data sources. For each data source IntelliJ IDEA opens a separate Input pane. For your convenience, the common console toolbar icons are also available from the Input pane.

Item Shortcut Description
runBuild.gif Ctrl+EnterCtrl+EnterCtrl+EnterCtrl+EnterCtrl+EnterCtrl+EnterCtrl+EnterCtrl+EnterCtrl+EnterMeta EnterMeta EnterMeta Enter Click this button to run the command at the caret or all the selected consecutive commands.
consoleHistory Browse history
Ctrl+Alt+ECtrl+Alt+ECtrl+Alt+ECtrl+Alt+ECtrl+Alt+ECtrl+Alt+ECtrl+Alt+ECtrl+Alt+ECtrl+Alt+EAlt Meta EAlt Meta EAlt Meta E
Click this button to show the list of commands, executed in the console. You can select the desired commands, and place them to the Input pane.
properties.gif Properties
Console.Jdbc.PropertiesConsole.Jdbc.PropertiesConsole.Jdbc.PropertiesConsole.Jdbc.PropertiesConsole.Jdbc.PropertiesConsole.Jdbc.PropertiesConsole.Jdbc.PropertiesConsole.Jdbc.PropertiesConsole.Jdbc.PropertiesConsole.Jdbc.PropertiesConsole.Jdbc.PropertiesConsole.Jdbc.Properties
Click this button to open the Database Console Properties dialog box, where you can specify the SQL dialect to use and customize the console behaviour.
close.png Close
Ctrl+Shift+F4Ctrl+Shift+F4Ctrl+Shift+4Ctrl+Shift+F4Ctrl+Shift+F4Ctrl+Shift+F4Ctrl+Shift+F4Ctrl+Shift+F4Ctrl+WShift Meta F4Shift Meta F4Meta W
Click this button to close the current instance of the Database console.
debug_layout.gif Layout Click this button to choose the desired layout of the toolbars from the pop-up menu. The available options are:
  • Horizontal Toolbars
  • Restore Layout

Result pane

Use this pane to view the result of executing queries as well as to add, remove, and update records in the queried table.

Item Shortcut Description
runBuild.gif Ctrl+EnterCtrl+EnterCtrl+EnterCtrl+EnterCtrl+EnterCtrl+EnterCtrl+EnterCtrl+EnterCtrl+EnterMeta EnterMeta EnterMeta Enter Click this button to run the command at the caret or all the selected consecutive commands.
consoleHistory Browse history
Ctrl+Alt+ECtrl+Alt+ECtrl+Alt+ECtrl+Alt+ECtrl+Alt+ECtrl+Alt+ECtrl+Alt+ECtrl+Alt+ECtrl+Alt+EAlt Meta EAlt Meta EAlt Meta E
Click this button to show the list of commands, executed in the console. You can select the desired commands, and place them to the Input pane.
properties.gif Properties
Console.Jdbc.PropertiesConsole.Jdbc.PropertiesConsole.Jdbc.PropertiesConsole.Jdbc.PropertiesConsole.Jdbc.PropertiesConsole.Jdbc.PropertiesConsole.Jdbc.PropertiesConsole.Jdbc.PropertiesConsole.Jdbc.PropertiesConsole.Jdbc.PropertiesConsole.Jdbc.PropertiesConsole.Jdbc.Properties
Click this button to open the Database Console Properties dialog box, where you can specify the SQL dialect to use and customize the console behaviour.
close.png Close
Ctrl+Shift+F4Ctrl+Shift+F4Ctrl+Shift+4Ctrl+Shift+F4Ctrl+Shift+F4Ctrl+Shift+F4Ctrl+Shift+F4Ctrl+Shift+F4Ctrl+WShift Meta F4Shift Meta F4Meta W
Click this button to close the current instance of the Database console.
dataSourceTableEditorFirstPage.png
dataSourceTableEditorLastPage.png
First Page
Last Page
Click this button to switch to the page with the first/last set of results.
dataSourceTableEditorPreviousPage
dataSourceTableEditorNextPage.png
Previous Page
Next Page
Ctrl+DownCtrl+DownCtrl+DownCtrl+DownCtrl+DownCtrl+DownCtrl+DownCtrl+DownCtrl+DownMeta DownMeta DownMeta DownCtrl+UpCtrl+UpCtrl+UpCtrl+UpCtrl+UpCtrl+UpCtrl+UpCtrl+UpCtrl+UpMeta UpMeta UpMeta Up
Click this button to switch to the page with the previous/next set of results.

Note

The number of items to be shown in a result set is configured in the Database Console Properties dialog.

refresh.png Reload Page
Ctrl+RCtrl+RCtrl+RCtrl+RShift+Alt+5Ctrl+RCtrl+HCtrl+HCtrl+FMeta RMeta RMeta R
Click this button to refresh the current page after editing or resorting the table data.
add.png Add New Row
Alt+InsertAlt+InsertAlt+InsertAlt+InsertAlt+InsertAlt+InsertAlt+InsertAlt+Insert or Ctrl+NAlt+InsertControl N or Control EnterControl N or Control EnterMeta N or Control Enter
Click this button to have a new record added to the queried table.
delete.png Delete Selected Rows
Ctrl+YCtrl+YCtrl+YCtrl+YCtrl+YCtrl+YCtrl+Shift+LCtrl+ECtrl+DMeta YMeta YMeta D
Click this button to remove the selected rows from the queried table.
icon_sqlCopyQuery.png Copy Query
Ctrl+Shift+Alt+CCtrl+Shift+Alt+CCtrl+Shift+Alt+CCtrl+Shift+Alt+CCtrl+Shift+Alt+CCtrl+Shift+Alt+CCtrl+Shift+Alt+CCtrl+Shift+Alt+CCtrl+Shift+Alt+CShift Alt Meta CShift Alt Meta CShift Alt Meta C
Click this button to save the query that produced the current result. The SQL command is stored in the clipboard.
icon_sqlCopyValues.png Copy
Ctrl+C or Ctrl+InsertCtrl+C or Ctrl+InsertCtrl+C or Ctrl+InsertCtrl+C or Ctrl+InsertCtrl+Insert, Alt+C or Escape, WCtrl+C or Ctrl+InsertCtrl+C or Ctrl+InsertCtrl+C or Ctrl+InsertCtrl+C or Ctrl+InsertMeta C or Meta InsertMeta C or Meta InsertMeta C or Meta Insert
Click this button to copy the values from the current result to the clipboard.

Output pane

This pane displays information on SQL command execution. This information includes:

  • Time stamp of the executed command.
  • Number of affected rows.
  • Duration in milliseconds. If the command execution involves processing the data received from the data source, the execution time is shown as x/y ms, where x is the time taken to receive the data, and y is the total time of generating the query result which includes both receiving and processing the data.
  • Error messages.
Item Description
Clear All Choose this option to have all the messages removed from the pane.
Copy Content Choose this option to have IntelliJ IDEA copy all the displayed messages to the clipboard.
Copy Selected Content Choose this option to have IntelliJ IDEA copy the selected messages to the clipboard.
Compare with Clipboard Choose this option to open the Differences Viewer an compare the contents of the clipboard with the entire contents of the Output pane or with a specific selected message.
Item Shortcut Description
runBuild.gif Ctrl+EnterCtrl+EnterCtrl+EnterCtrl+EnterCtrl+EnterCtrl+EnterCtrl+EnterCtrl+EnterCtrl+EnterMeta EnterMeta EnterMeta Enter Click this button to run the command at the caret or all the selected consecutive commands.
consoleHistory Browse history
Ctrl+Alt+ECtrl+Alt+ECtrl+Alt+ECtrl+Alt+ECtrl+Alt+ECtrl+Alt+ECtrl+Alt+ECtrl+Alt+ECtrl+Alt+EAlt Meta EAlt Meta EAlt Meta E
Click this button to show the list of commands, executed in the console. You can select the desired commands, and place them to the Input pane.
properties.gif Properties
Console.Jdbc.PropertiesConsole.Jdbc.PropertiesConsole.Jdbc.PropertiesConsole.Jdbc.PropertiesConsole.Jdbc.PropertiesConsole.Jdbc.PropertiesConsole.Jdbc.PropertiesConsole.Jdbc.PropertiesConsole.Jdbc.PropertiesConsole.Jdbc.PropertiesConsole.Jdbc.PropertiesConsole.Jdbc.Properties
Click this button to open the Database Console Properties dialog box, where you can specify the SQL dialect to use and customize the console behaviour.
close.png Close
Ctrl+Shift+F4Ctrl+Shift+F4Ctrl+Shift+4Ctrl+Shift+F4Ctrl+Shift+F4Ctrl+Shift+F4Ctrl+Shift+F4Ctrl+Shift+F4Ctrl+WShift Meta F4Shift Meta F4Meta W
Click this button to close the current instance of the Database console.

Parameters pane

Item Description
Parameter This read-only field displays the names of parameters detected in the current SQL statement.
Value In this text box, type the value to substitute for the parameter when the statement will be executed.

Context menu of a tab

Context menu command Description Available in
Detach Choose this command to detach the selected view. This enables you to move the detached pane to any desired location. All panes

Note

The Output and the Result panes can be detached only together.

Close Choose this command to close the current tab. Result pane
Focus on Startup If this option is selected, the current pane gets the focus on launching the Database console. All panes
Select Next Tab/
Select Previous Tab
Use these commands to switch the focus between tabs within the Result pane or between the Output and the Result panes. Output pane
Result pane

See Also

Language and Framework-Specific Guidelines:

Reference:

Getting Started:

Web Resources: