Skip to content

Microsoft SQL Server

Microsoft SQL Server is a relational database management system (RDBMS) developed by Microsoft. It provides a comprehensive suite of tools for managing and analyzing data, supporting a wide range of business intelligence and data warehousing applications. When using Microsoft SQL Server with Martini Runtime, you can leverage its JDBC (Java Database Connectivity) capabilities to establish a connection between your application and the SQL Server database. This allows you to execute SQL queries, retrieve data, and perform various database operations directly from within your Martini environment.

Configuring Microsoft SQL Server

To connect Martini Runtime to SQL Server, you'll need to configure a JDBC connection string with the necessary details, such as the server address, port number, and authentication credentials. This configuration ensures that Martini Runtime can communicate effectively with your SQL Server instance, enabling seamless data integration and management within your application. Here's a straightforward guide to adding a new database connection:

Configuration Guide

Via API Explorer: Database connections can be configured using the Martini API Explorer, a user-friendly interface designed for efficient interaction with the system's APIs. Follow these steps to configure the database connections through the API Explorer:

  1. Access the API Explorer: Open a web browser and go to [HOST]:8080/api-explorer/ to access the API Explorer.

  2. Navigate to the Database Tag: Locate and click on the database tag within the API Explorer to view various database configuration and operation endpoints.

  3. Configure Connection Pool: Use the esbapi/databases endpoint found under the database tag to save a database connection pool.

  4. Use POST to Save a Connection Pool: Save the connection pool by using the POST method at the /esbapi/databases endpoint. Here is a minimum requirement for a JSON payload:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
     {
         "name": "[name]",
         "type": "jdbc",
         "url": "jdbc:sqlserver://[HOST]:[PORT];[ConnectionProperties];",
         // For example: "jdbc:sqlserver://localhost:1433;encrypt=false;"
         "driverClassName": "com.microsoft.sqlserver.jdbc.SQLServerDriver", // JDBC driver for Microsoft SQL Server
         "username": "sa",
         // The default system administrator account is 'sa', but you may use a different SQL Server user account depending on your setup
         "password": "[password]" 
     }
    

Via File System: Alternatively, database connections can be modified directly in the file system by editing the <name>.dbxml file located in the /<martini-home>/conf/db-pool/ directory. The <name>.dbxml file refers to the specific file for your database configuration. This method is particularly useful in environments with restricted API access or during initial setup stages.

To modify database connections directly through the file system, follow these steps:

  1. Locate the Configuration File: Navigate to the /<martini-home>/conf/db-pool/ directory on your server and locate the <name>.dbxml file.

  2. Edit the Database Connections: Open the <name>.dbxml file in a text editor and modify the database connection properties.

  3. Save and Restart: After making the desired changes, save the file. It is essential to restart the Martini Runtime instance to apply the new settings. This ensures that all components of the application use the updated JDBC configuration. Here is a minimum requirement for a dbXML:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
     <database>
         <name>[name]</name>
         <type>jdbc</type>
         <url>jdbc:sqlserver://[HOST]:[PORT];[ConnectionProperties];</url>
         <!-- Example: "jdbc:sqlserver://localhost:1433;encrypt=false;" -->
         <driverClassName>com.microsoft.sqlserver.jdbc.SQLServerDriver</driverClassName> <!-- JDBC driver for Microsoft SQL Server -->
         <username>sa</username>
         <!-- The default system administrator account is 'sa', but you may use a different SQL Server user account depending on your setup. -->
         <password>[password]</password>
     </database>
    

Configuring Microsoft SQL Server in Martini Designer

  1. Navigate to the Navigator view and right-click on the Databases node of the instance where you intend to add the database connection.
  2. Choose New > Database Connection.
  3. Specify a name for the connection and select the database type JDBC.
  4. Fill in the database connection details in the provided form.
  5. Save the changes.

Connection Properties

For more details on constructing a JDBC connection URL for SQL Server, you can refer to the official documentation: Building the Connection URL.

Database Properties

These properties include various settings that control the operation of the database. For detailed information on configuring these settings, refer to the JDBC database properties documentation.