Obtaining and Installing the Java SDK
Obtaining DLI SDKs
On the DLI management console, download the SDK installation package dli-sdk-java-x.x.x.zip and extract it. The directory structure after extraction is shown in the table below.
Parameter |
Description |
---|---|
jars |
SDK and its dependent JAR packages. |
maven-install |
Script and JAR package that are installed in the local Maven repository. |
dli-sdk-java.version |
Java SDK version description. |
Installing the SDK
- Method 1: Adding the SDK using the Maven central repository
The Maven central repository is part of the Apache Maven project that provides Java libraries and frameworks.
When the SDK retrieval method is not specified, the default approach is to add the SDK driver using the Maven central repository.
Use Maven to add the Maven configuration items on which huaweicloud-dli-sdk depends. (This is the default operation and does not need to be separately configured.)1 2 3 4 5
<dependency> <groupId>com.huawei.dli</groupId> <artifactId>huaweicloud-dli-sdk-java</artifactId> <version>x.x.x</version> </dependency>
- Method 2: Obtaining the SDK using Maven to configure the Huawei image source
When using Maven to manage project dependencies, you can modify the settings.xml file to configure the Huawei image source to obtain the SDK.
<mirror> <id>huaweicloud</id> <mirrorOf>*</mirrorOf> <url>https://mirrors.huaweicloud.com/repository/maven/</url> </mirror>
- Method 3: Downloading the JDBC driver file from the DLI management console
- Log in to the DLI management console.
- Click SDK Download in the Common Links area on the right of the Overview page.
- On the DLI SDK DOWNLOAD page, select a driver and download it.
Click huaweicloud-dli-sdk-java-x.x.x to download a JDBC driver package.
The JDBC driver package is named huaweicloud-dli-sdk-java-<version>.zip. It can be used in all versions of all platforms (such as Linux and Windows) and depends on JDK 1.7 or later.
- The downloaded JDBC driver package contains .bat (Windows) or .sh (Linux/Mac) scripts, which are used to automatically install the SDK driver to the local Maven repository.
You can choose a script based on your OS to install the JDBC driver.
- Windows: Double-click the .bat file or run the file in the CLI.
- Linux/Mac: Run the .sh script.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot