Hướng dẫn connect android to sql server 2008 năm 2024

This functionality relies on the Database Tools and SQL plugin, which is bundled and enabled in IntelliJ IDEA by default. If the relevant features aren't available, make sure that you didn't disable the plugin.

  1. Press Control+Alt+S to open the IDE settings and then select .
  2. Open the Installed tab, find the Database Tools and SQL plugin, and select the checkbox next to the plugin name.

Official documentation and software

  • For full information about Microsoft SQL Server, refer to the official documentation.
  • To download Microsoft SQL Server database software, refer to the official software downloads.

This topic gives you an example of how you can configure Microsoft SQL Server and create a connection to it from IntelliJ IDEA. If you already have Microsoft SQL Server installed and configured, consider jumping to the section that describes in IntelliJ IDEA.

Required settings

Microsoft SQL Server accepts TCP/IP connections on a dedicated port. By default, it is port 1433 and it is closed by the Microsoft Windows Firewall. When connecting via port, make sure that the port that you use is not closed by the Firewall.

If the SQL Server Browser is turned on, TCP/IP connection can also be established using the Microsoft SQL Server instance name.

Enable and configure the TCP/IP connection

  • Follow the to enable the protocol, check and assign a port number. Verify that other running applications do not use the same port. Name of the Microsoft SQL Server instance is MSSQLSERVER. By default, the port is 1433.

Connect to Microsoft SQL Server with IntelliJ IDEA

The following section describes configuration of IntelliJ IDEA on , , and . Note that the Use Windows domain authentication checkbox is available only on Windows. To configure Windows domain authentication on macOS and Linux, refer to .

Connect by using Kerberos

First, you need to obtain a ticket for a user. To obtain the ticket, you need to run the kinit command with the username.

Run kinit in the command prompt

  1. In the command prompt or in the terminal, run the following command: kinit sqlsrvkrb Instead of sqlsrvkrb, use your username.
  2. Enter a password for the username.

Create a data source

  • To connect to the database, create a data source that will store your connection details. You can do this using one of the following ways:
  • In the main menu, go to and select Microsoft SQL Server.
  • In the Database tool window ( ) , click the New icon () in the toolbar. Navigate to Data Source and select Microsoft SQL Server.
    Hướng dẫn connect android to sql server 2008 năm 2024
  • Click the Driver link and select the driver for your connection.
  • Check if there is a Download missing driver files link at the bottom of the connection settings area. Click this link to download drivers that are required to interact with a database. For a direct download link, refer to the JetBrains JDBC drivers page. Location for the downloaded JDBC drivers is the .
    Hướng dẫn connect android to sql server 2008 năm 2024
    You can also use your drivers for the database instead of the provided ones. For more information about connecting to a database with your driver, refer to . If there is no Download missing driver files link, then you already have the required drivers.
  • Specify the database connection details. Alternatively, paste the JDBC URL in the URL field.
  • In Host, Instance, and Port fields, specify your connection details.
  • From the Authentication list, select Kerberos.
  • In the User and Password fields, type your user credentials. To use no password, leave the Password field empty. To delete a once entered password, right-click the Password field and select Set Empty.
    Hướng dẫn connect android to sql server 2008 năm 2024
  • In the Database field, type the database name to which you want to connect.
  • Ensure that the connection to the database can be established using the provided details. To do that, click the Test Connection link at the bottom of the connection details area.
    Hướng dẫn connect android to sql server 2008 năm 2024
    In case of any connection issues, refer to the Cannot connect to a database page.
  • (Optional) By default, only the default database and schema are introspected and available to work with. If you also want to work with other databases and schemas, in the Schemas tab, select them for the introspection.
    Hướng dẫn connect android to sql server 2008 năm 2024
  • Click OK to create the data source.

Find your new data source in the Database tool window (Shortcut is missing) .

  • For more information about the Database tool window, see the corresponding reference topic.
  • For more information about working with database objects in IntelliJ IDEA, refer to Database objects.
  • To write and run queries, open the default query console by clicking the data source and pressing F4.

To view and edit data of a database object, open Data editor and viewer by double-clicking the object.