VOOZH about

URL: https://www.cdata.com/kb/tech/azuredatalake-jdbc-ibm-websphere.rst

⇱ Connect Azure Data Lake Storage to IBM WebSphere Using the CData JDBC Driver


Connect Azure Data Lake Storage to IBM WebSphere Using the CData JDBC Driver

πŸ‘ Anusha M B
Anusha M B
Technical Marketing Engineer
Use the CData JDBC Driver to connect Azure Data Lake Storage with IBM WebSphere for seamless data integration and connectivity.

IBM WebSphere is a powerful application server that runs many enterprise level Java applications and services. When paired with the CData JDBC Driver for Azure Data Lake Storage, IBM WebSphere applications can connect to Azure Data Lake Storage and work with data using standard SQL queries instead of complex APIs. This simplifies integration, reduces development effort, and provides secure, real-time access to critical business data.

Prerequisites

  1. Access to a Azure Data Lake Storage account (with API permissions)
  2. IBM WebSphere Application Server (configured and running)
  3. CData JDBC Driver for Azure Data Lake Storage
  4. Java Servlet WAR application ready for deployment

Note: This article uses Salesforce as a demonstration data source, but the same steps can be followed to connect to any of the 250+ JDBC Drivers available in our portfolio.

Getting Started

Step 1: Download and install the CData JDBC Driver for Azure Data Lake Storage

Download and install the CData JDBC Driver for Azure Data Lake Storage, which provides a .jar file: cdata.jdbc.adls.jar

Step 2: Install and configure IBM Websphere

  1. Create an account in IBM WebSphere using the official IBM site.
  2. Install and configure the IBM Websphere Application server in the local system using the documentation: IBM Websphere Application Server
  3. Once the application server is installed, start the WebSphere Server using the Admin Console in your browser: https://your-server:9043/ibm/console
  4. πŸ‘ Login to Websphere admin console

Step 3: Set up the JDBC provider and data source for Azure Data Lake Storage

  1. Go to Resources, expand the JDBC section, and then select JDBC providers to create a new provider
  2. πŸ‘ Create new JDBC providers
  3. Select the appropriate scope from the drop down menu
  4. πŸ‘ Select the scopes
  5. Click New to add a JDBC provider
    • Choose User defined as the database type
    • Enter cdata.jdbc.adls.ADLSConnectionPoolDataSource as the implementation class name
    • Type a name for the provider, for example User defined JDBC Provider
    • Enter the full path of the JDBC driver JAR file in the classpath field
    • Click Next, then Finish, and save the changes to the master configuration.
    πŸ‘ Creating JDBC Provider
  6. Once the JDBC provider is created, add a JDBC data source.
    • Enter the basic details such as Data Source Name and JNDI name
    • Select the existing JDBC provider created earlier (e.g., CData Azure Data Lake Storage Provider)
    • Provide the Implementation class name: cdata.jdbc.adls.ADLSConnectionPoolDataSource
    • Add the Data Store Helper Class Name: com.ibm.websphere.rsadapter.GenericDataStoreHelper
    • Configure security by setting authentication aliases if required
    • Review the Summary page to verify all details and click Finish to complete the data source creation
    • πŸ‘ Adding JDBC data source
  7. Select the newly created data source from the list and open Custom properties
  8. Add the JDBC connection string under the URL property and press OK. For example:
    jdbc:adls:RTK=5246...;Schema=ADLSGen2;Account=myAccount;FileSystem=myFileSystem;AccessKey=myAccessKey;InitiateOAuth=GETANDREFRESH;

    Authenticating to a Gen 1 DataLakeStore Account

    Gen 1 uses OAuth 2.0 in Entra ID (formerly Azure AD) for authentication.

    For this, an Active Directory web application is required. You can create one as follows:

    1. Sign in to your Azure Account through the
    2. Select "Entra ID" (formerly Azure AD).
    3. Select "App registrations".
    4. Select "New application registration".
    5. Provide a name and URL for the application. Select Web app for the type of application you want to create.
    6. Select "Required permissions" and change the required permissions for this app. At a minimum, "Azure Data Lake" and "Windows Azure Service Management API" are required.
    7. Select "Key" and generate a new key. Add a description, a duration, and take note of the generated key. You won't be able to see it again.

    To authenticate against a Gen 1 DataLakeStore account, the following properties are required:

    • Schema: Set this to ADLSGen1.
    • Account: Set this to the name of the account.
    • OAuthClientId: Set this to the application Id of the app you created.
    • OAuthClientSecret: Set this to the key generated for the app you created.
    • TenantId: Set this to the tenant Id. See the property for more information on how to acquire this.
    • Directory: Set this to the path which will be used to store the replicated file. If not specified, the root directory will be used.

    Authenticating to a Gen 2 DataLakeStore Account

    To authenticate against a Gen 2 DataLakeStore account, the following properties are required:

    • Schema: Set this to ADLSGen2.
    • Account: Set this to the name of the account.
    • FileSystem: Set this to the file system which will be used for this account.
    • AccessKey: Set this to the access key which will be used to authenticate the calls to the API. See the property for more information on how to acquire this.
    • Directory: Set this to the path which will be used to store the replicated file. If not specified, the root directory will be used.

    Built-in Connection String Designer

    For assistance in constructing the JDBC URL, use the connection string designer built into the Azure Data Lake Storage JDBC Driver. Either double-click the JAR file or execute the jar file from the command-line.

     java -jar cdata.jdbc.adls.jar
     

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

    πŸ‘ Using the built-in connection string designer to generate a JDBC URL (Salesforce is shown.)

    Note: If the URL property is not available, create it and then add the JDBC connection string.

    Tip: Always test the connection string with the driver before entering it in the URL property. πŸ‘ Adding JDBC data source
  9. Now open the data source and choose Test Connection
  10. πŸ‘ Testing the connection

Step 4: Build the web application

  1. Build the web application using preferred Java framework (Servlet, JSP, or Spring). The resulting .war file will typically follow a structure like this:
  2. 		Azure Data Lake StorageServletApp.war
    		|--webcontent
    		| |--index.jsp -- JSP page (entry point)
    		| |
    		| |--WEB-INF/ --Hidden from direct browser access
    		| |--web.xml -- Deployment descriptor
    		| |
    		| |--classes/ --Compiled .class files
    		| |--com/example/Azure Data Lake Storage/
    		| |--Azure Data Lake StorageServlet.class
    		|
    		|--lib/ --Dependency JARs
    		|--cdata.jdbc.azuredatalake.jar
    	
  3. Define the data access logic using JDBC or JPA, referencing the data source through a JNDI name
  4. This article explains how to set up a JDBC connection and deploy a Java Servlet application
  5. Package the project as a WAR (Web Application Archive) or EAR (Enterprise Archive) file for deployment
    • In a terminal compile the java file using the command:
      			cd webcontent
      			jar cvf ..\Azure Data Lake StorageServletApp.war *
      		

Step 5: Deploy the Azure Data Lake Storage application in WebSphere

  1. In the WebSphere admin console, go to Applications and select Install New Application
  2. Browse and upload the WAR file, then continue with the installation wizard.

Step 6: Retrieve Azure Data Lake Storage data through WebSphere

  1. Access the application using its context root: http://hostname:port/context-root/page
  2. πŸ‘ Demo application
    Note: Ensure the deployed application is started before opening it in the browser. πŸ‘ Data is retrieved

We can now view the retrieved data from the source. The data is accessible directly through IBM WebSphere. This setup demonstrates how a servlet can be deployed in WebSphere to retrieve Azure Data Lake Storage data using the JDBC driver, creating a strong foundation for building advanced Azure Data Lake Storage powered enterprise applications.

Get Started with Connecting Azure Data Lake Storage to IBM WebSphere

Start connecting Azure Data Lake Storage to IBM WebSphere with the CData JDBC Connector today. Download the free 30-day trial and explore how easy it is to enable secure, real-time data access for your applications. As always, our world-class Support Team is available to help with any questions you may have.

Ready to get started?

Download a free trial of the Azure Data Lake Storage Driver to get started:

 Download Now

Learn more:

πŸ‘ Azure Data Lake Storage Icon
Azure Data Lake Storage JDBC Driver

Rapidly create and deploy powerful Java applications that integrate with Azure Data Lake Storage.