Debugging the Sample Application in Windows
You can run the applications in a Windows development environment. If the local and cluster service planes can communicate with each other, you can debug the application on the local host.
- If the IBM JDK is used in the Windows environment, the application cannot run in the Windows environment.
- You need to set the one-on-one mapping between the host names and IP addresses of the access nodes in the hosts file on the local host where you run the sample code.
- Only the JDBC sample program can run in the local Windows environment.
Procedure
- Compile the JDBC sample program.
Click Terminal in the lower left corner of the IDEA page to access the terminal. Run the mvn clean package command to perform compilation.
If "BUILD SUCCESS" is displayed, the compilation is successful. A JAR file containing the -with-dependencies field is generated in the target directory of the sample project.
- Run the JDBC sample program.
- Run the JDBC sample project using the Windows command line interface.
- Create a directory on Windows as the running directory, for example, D:\jdbc_example. Save the JAR packages whose names contain -with-dependencies generated in 1 in the target directory to this directory. Create the src/main/resources subdirectory in the directory and copy all files in the hive-jdbc-example\src\main\resources directory obtained in Configuring and Importing the JDBC/HCatalog Sample Project to the src/main/resources directory.
- Run the JAR package.
java -jar hive-jdbc-example-1.0-SNAPSHOT-jar-with-dependencies.jar
The preceding JAR file name is for reference only. Replace it with the actual one.
- View the HiveQL query results of the sample code in the command line interface. If the following information is displayed, the execution is successful.
Create table success! _c0 0 Delete table success!
- Run the JDBC sample project in IntelliJ IDEA.
- Right-click the JDBCExample class of the jdbc-examples project of IntelliJ IDEA and choose Run JDBCExample.main() from the shortcut menu.
- In the output window, view the HiveQL query result of the sample code. The following information is displayed:
Create table success! _c0 0 Delete table success!
- Right-click the JDBCExample class of the jdbc-examples project of IntelliJ IDEA and choose Run JDBCExample.main() from the shortcut menu.
- Run the JDBC sample project using the Windows command line interface.
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