VOOZH about

URL: https://www.cdata.com/kb/tech/sql-jdbc-hulft-integrate.rst

โ‡ฑ Connect to SQL Server Data in HULFT Integrate


Connect to SQL Server Data in HULFT Integrate

๐Ÿ‘ Jerod Johnson
Jerod Johnson
Director, Technology Evangelism
Connect to SQL Server as a JDBC data source in HULFT Integrate

HULFT Integrate is a modern data integration platform that provides a drag-and-drop user interface to create cooperation flows, data conversion, and processing so that complex data connections are easier than ever to execute. When paired with the CData JDBC Driver for SQL Server, HULFT Integrate can work with live SQL Server data. This article explains how to connect to SQL Server and move the data into a CSV file.

With built-in optimized data processing, the CData JDBC driver offers unmatched performance for interacting with live SQL Server data. When you issue complex SQL queries to SQL Server, the driver pushes supported SQL operations, like filters and aggregations, directly to SQL Server and utilizes the embedded SQL engine to process unsupported operations client-side (often SQL functions and JOIN operations). Its built-in dynamic metadata querying allows you to work with and analyze SQL Server data using native data types.

Enable Access to SQL Server

To enable access to SQL Server data from HULFT Integrate projects:

  1. Copy the CData JDBC Driver JAR file (and license file if it exists), cdata.jdbc.sql.jar (and cdata.jdbc.sql.lic), to the jdbc_adapter subfolder for the Integrate Server
  2. Restart the HULFT Integrate Server and launch HULFT Integrate Studio

Build a Project with Access to SQL Server Data

Once you copy the JAR files, you can create a project with access to SQL Server data. Start by opening Integrate Studio and creating a new project.

  1. Name the project
  2. Ensure the "Create script" checkbox is checked
  3. Click Next ๐Ÿ‘ Creating a new project.
  4. Name the script (e.g.: SQLtoCSV)

Once you create the project, add components to the script to copy SQL Server data to a CSV file.

Configure an Execute Select SQL Component

Drag an "Execute Select SQL" component from the Tool Palette (Database -> JDBC) into the Script workspace.

  1. In the "Required settings" tab for the Destination, click "Add" to create a new connection for SQL Server. Set the following properties:
    • Name: SQL Server Connection Settings
    • Driver class name: cdata.jdbc.sql.SQLDriver
    • URL: jdbc:sql:User=myUser;Password=myPassword;Database=NorthWind;Server=myServer;Port=1433;

      ๐Ÿ‘ JDBC connection settings (Salesforce is shown).

      Built-in Connection String Designer

      For assistance constructing the JDBC URL, use the connection string designer built into the SQL Server JDBC Driver. Either double-click the JAR file or execute the JAR file from the command-line.

      		java -jar cdata.jdbc.sql.jar
      		

      Fill in the connection properties and copy the connection string to the clipboard.

      Connecting to Microsoft SQL Server

      Connect to Microsoft SQL Server using the following properties:

      • Server: The name of the server running SQL Server.
      • User: The username provided for authentication with SQL Server.
      • Password: The password associated with the authenticating user.
      • Database: The name of the SQL Server database.

      Connecting to Azure SQL Server and Azure Data Warehouse

      You can authenticate to Azure SQL Server or Azure Data Warehouse by setting the following connection properties:

      • Server: The server running Azure. You can find this by logging into the Azure portal and navigating to "SQL databases" (or "SQL data warehouses") -> "Select your database" -> "Overview" -> "Server name."
      • User: The name of the user authenticating to Azure.
      • Password: The password associated with the authenticating user.
      • Database: The name of the database, as seen in the Azure portal on the SQL databases (or SQL warehouses) page.

      SSH Connectivity for SQL Server

      You can use SSH (Secure Shell) to authenticate with SQL Server, whether the instance is hosted on-premises or in supported cloud environments. SSH authentication ensures that access is encrypted (as compared to direct network connections).

      SSH Connections to SQL Server in Password Auth Mode

      To connect to SQL Server via SSH in Password Auth mode, set the following connection properties:

      • User: SQL Server User name
      • Password: SQL Server Password
      • Database: SQL Server database name
      • Server: SQL Server Server name
      • Port: SQL Server port number like 3306
      • UserSSH: "true"
      • SSHAuthMode: "Password"
      • SSHPort: SSH Port number
      • SSHServer: SSH Server name
      • SSHUser: SSH User name
      • SSHPassword: SSH Password

      SSH Connections to SQL Server in Public Key Auth Mode

      To connect to SQL Server via SSH in Password Auth mode, set the following connection properties:

      • User: SQL Server User name
      • Password: SQL Server Password
      • Database: SQL Server database name
      • Server: SQL Server Server name
      • Port: SQL Server port number like 3306
      • UserSSH: "true"
      • SSHAuthMode: "Public_Key"
      • SSHPort: SSH Port number
      • SSHServer: SSH Server name
      • SSHUser: SSH User name
      • SSHClientCret: the path for the public key certificate file
      ๐Ÿ‘ Using the built-in connection string designer to generate a JDBC URL (Salesforce is shown.)
  2. Write your SQL statement. For example:
    SELECT ShipName, Freight FROM Orders
  3. Click "Extraction test" to ensure the connection and query are configured properly
  4. Click "Execute SQL statement and set output schema"
  5. Click "Finish" ๐Ÿ‘ Configuring the Execute Select SQL operation

Configure a Write CSV File Component

Drag a "Write CSV File" component from the Tool Palette (File -> CSV) onto the workspace.

  1. Set a file to write the query results to (e.g. Orders.csv)
  2. Set "Input data" to the "Select SQL" component
  3. Add columns for each field selected in the SQL query
  4. In the "Write settings" tab, check the checkbox to "Insert column names into first row"
  5. Click "Finish"

Map SQL Server Fields to the CSV Columns

Map each column from the "Select" component to the corresponding column for the "CSV" component.

Finish the Script

Drag the "Start" component onto the "Select" component and the "CSV" component onto the "End" component. Build the script and run the script to move SQL Server data into a CSV file.

๐Ÿ‘ A completed script.

Download a free, 30-day trial of the CData JDBC Driver for SQL Server and start working with your live SQL Server data in HULFT Integrate. Reach out to our Support Team if you have any questions.

Ready to get started?

Download a free trial of the SQL Server Driver to get started:

 Download Now

Learn more:

๐Ÿ‘ Microsoft SQL Server Icon
SQL Server Driver

Rapidly create and deploy powerful Java applications that integrate with Microsoft SQL Server.