This is an automated email from the ASF dual-hosted git repository.
peacewong pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/linkis-website.git
The following commit(s) were added to refs/heads/dev by this push:
new da3a42f955 update jdbc doc (#645)
da3a42f955 is described below
commit da3a42f95589dc2f783e007823ba6e5171011335
Author: peacewong <[email protected]>
AuthorDate: Sat Dec 31 23:51:28 2022 +0800
update jdbc doc (#645)
---
docs/api/jdbc-api.md | 36 ++++++++++-------
.../current/api/jdbc-api.md | 45 +++++++++++++--------
.../version-1.2.0/api/jdbc-api.md | 47 +++++++++++++---------
.../version-1.3.0/api/jdbc-api.md | 47 +++++++++++++---------
versioned_docs/version-1.2.0/api/jdbc-api.md | 47 +++++++++++++---------
versioned_docs/version-1.3.0/api/jdbc-api.md | 46 ++++++++++++---------
6 files changed, 163 insertions(+), 105 deletions(-)
diff --git a/docs/api/jdbc-api.md b/docs/api/jdbc-api.md
index 76d16577aa..59b14d4a8e 100644
--- a/docs/api/jdbc-api.md
+++ b/docs/api/jdbc-api.md
@@ -10,32 +10,36 @@ The first way depends on the JDBC module in the pom:
```xml
<dependency>
<groupId>org.apache.linkis</groupId>
- <artifactId>linkis-ujes-jdbc</artifactId>
+ <artifactId>linkis-jdbc-driver</artifactId>
<version>${linkis.version}</version>
</dependency>
```
-**Note:** The module has not been deployed to the central repository. You need
to execute `mvn install -Dmaven.test.skip=true` in the ujes/jdbc directory for
local installation.
+**Note:** The module has not been deployed to the central repository. You need
to execute `mvn install -Dmaven.test.skip=true` in the
linkis-computation-governance/linkis-jdbc-driver directory for local
installation.
**The second way is through packaging and compilation:**
-1. Enter the ujes/jdbc directory in the Linkis project and enter the command
in the terminal to package `mvn assembly:assembly -Dmaven.test.skip=true`
+1. Enter the linkis-jdbc-driver directory in the Linkis project and enter the
command in the terminal to package `mvn assembly:assembly
-Dmaven.test.skip=true`
The packaging instruction skips the running of the unit test and the
compilation of the test code, and packages the dependencies required by the
JDBC module into the Jar package.
2. After the packaging is complete, two Jar packages will be generated in the
target directory of JDBC. The one with dependencies in the Jar package name is
the Jar package we need.
### 2. Create A Test Category
-Establish a Java test class LinkisClientImplTestJ, the specific interface
meaning can be seen in the notes:
+Establish a Java test class LinkisJDBCTest, the specific interface meaning can
be seen in the notes:
```java
- public static void main(String[] args) throws SQLException,
ClassNotFoundException {
+package org.apache.linkis.jdbc.test;
- //1. Load driver class:org.apache.linkis.ujes.jdbc.UJESSQLDriver
- Class.forName("org.apache.linkis.ujes.jdbc.UJESSQLDriver");
+import java.sql.*;
+
+public class LinkisJDBCTest {
- //2. Get connection:jdbc:linkis://gatewayIP:gatewayPort
- // the front-end account password
- Connection connection =
DriverManager.getConnection("jdbc:linkis://127.0.0.1:9001","username","password");
+ public static void main(String[] args) throws SQLException,
ClassNotFoundException {
- //3. Create statement and execute query
+ //1. load driver:org.apache.linkis.ujes.jdbc.UJESSQLDriver
+ Class.forName("org.apache.linkis.ujes.jdbc.UJESSQLDriver");
+
+ //2. Get
Connection:jdbc:linkis://gatewayIP:gatewayPort/dbName?EngineType=hive&creator=test,
user/password
+ Connection connection =
DriverManager.getConnection("jdbc:linkis://10.107.118.104:9001/default?EngineType=hive&creator=test","hadoop","hadoop");
+ //3. Create statement
Statement st= connection.createStatement();
ResultSet rs=st.executeQuery("show tables");
- //4. Processing the returned results of the database (using the
ResultSet class)
+ //4.get result
while (rs.next()) {
ResultSetMetaData metaData = rs.getMetaData();
for (int i = 1; i <= metaData.getColumnCount(); i++) {
@@ -43,9 +47,13 @@ Establish a Java test class LinkisClientImplTestJ, the
specific interface meanin
}
System.out.println();
}
- // close resourse
+ //close resource
rs.close();
st.close();
connection.close();
}
-```
\ No newline at end of file
+}
+```
+
+1. Where EngineType is the specified corresponding engine type: supports
Spark/hive/presto/shell, etc.
+2. Creator is the specified corresponding application type, which is used for
resource isolation between applications
\ No newline at end of file
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/api/jdbc-api.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/api/jdbc-api.md
index 031c660407..7c69619b39 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/api/jdbc-api.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/api/jdbc-api.md
@@ -1,5 +1,5 @@
---
-title: 任务提交执行 JDBC API 文档
+title: JDBC Driver 文档
sidebar_position: 4
---
## 1. 引入依赖模块:
@@ -7,32 +7,38 @@ sidebar_position: 4
```xml
<dependency>
<groupId>org.apache.linkis</groupId>
- <artifactId>linkis-ujes-jdbc</artifactId>
+ <artifactId>linkis-jdbc-driver</artifactId>
<version>${linkis.version}</version>
- </dependency>
-```
-**注意:** 该模块还没有deploy到中央仓库,需要在ujes/jdbc目录里面执行`mvn install
-Dmaven.test.skip=true`进行本地安装。
+</dependency>
+```
+**注意:**
该模块还没有deploy到中央仓库,需要在linkis-computation-governance/linkis-jdbc-driver目录里面执行`mvn
install -Dmaven.test.skip=true`进行本地安装。
**第二种方式通过打包和编译:**
-1. 在Linkis项目中进入到ujes/jdbc目录然后在终端输入指令进行打包`mvn assembly:assembly
-Dmaven.test.skip=true`
+1.
在Linkis项目中进入到linkis-computation-governance/linkis-jdbc-driver目录然后在终端输入指令进行打包`mvn
assembly:assembly -Dmaven.test.skip=true`
该打包指令会跳过单元测试的运行和测试代码的编译,并将JDBC模块需要的依赖一并打包进Jar包之中。
-2. 打包完成后在JDBC的target目录下会生成两个Jar包,Jar包名称中包含dependencies字样的那个就是我们需要的Jar包
+2. 打包完成后在JDBC的target目录下会生成两个Jar包,Jar包名称中包含dependencies字样的那个就是我们需要的驱动包
## 2. 建立测试类:
-建立Java的测试类LinkisClientImplTestJ,具体接口含义可以见注释:
+建立Java的测试类LinkisJDBCTest,具体接口含义可以见注释:
+
```java
- public static void main(String[] args) throws SQLException,
ClassNotFoundException {
+package org.apache.linkis.jdbc.test;
- //1. 加载驱动类:org.apache.linkis.ujes.jdbc.UJESSQLDriver
- Class.forName("org.apache.linkis.ujes.jdbc.UJESSQLDriver");
+import java.sql.*;
+
+public class LinkisJDBCTest {
- //2. 获得连接:jdbc:linkis://gatewayIP:gatewayPort 帐号和密码对应前端的帐号密码
- Connection connection =
DriverManager.getConnection("jdbc:linkis://127.0.0.1:9001","username","password");
+ public static void main(String[] args) throws SQLException,
ClassNotFoundException {
- //3. 创建statement 和执行查询
+ //1. load driver:org.apache.linkis.ujes.jdbc.UJESSQLDriver
+ Class.forName("org.apache.linkis.ujes.jdbc.UJESSQLDriver");
+
+ //2. Get
Connection:jdbc:linkis://gatewayIP:gatewayPort/dbName?EngineType=hive&creator=test,
user/password
+ Connection connection =
DriverManager.getConnection("jdbc:linkis://10.107.118.104:9001/default?EngineType=hive&creator=test","hadoop","hadoop");
+ //3. Create statement
Statement st= connection.createStatement();
ResultSet rs=st.executeQuery("show tables");
- //4.处理数据库的返回结果(使用ResultSet类)
+ //4.get result
while (rs.next()) {
ResultSetMetaData metaData = rs.getMetaData();
for (int i = 1; i <= metaData.getColumnCount(); i++) {
@@ -40,9 +46,14 @@ sidebar_position: 4
}
System.out.println();
}
- //关闭资源
+ //close resource
rs.close();
st.close();
connection.close();
}
-```
\ No newline at end of file
+}
+```
+
+备注:
+1. 其中EngineType为指定对应的引擎类型:支持Spark/hive/presto/shell等
+2. 其中creator为指定对应的应用类型,用于应用间的资源隔离
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.2.0/api/jdbc-api.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.2.0/api/jdbc-api.md
index 031c660407..637568e093 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.2.0/api/jdbc-api.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.2.0/api/jdbc-api.md
@@ -1,5 +1,5 @@
---
-title: 任务提交执行 JDBC API 文档
+title: JDBC Driver 文档
sidebar_position: 4
---
## 1. 引入依赖模块:
@@ -7,32 +7,38 @@ sidebar_position: 4
```xml
<dependency>
<groupId>org.apache.linkis</groupId>
- <artifactId>linkis-ujes-jdbc</artifactId>
+ <artifactId>linkis-jdbc-driver</artifactId>
<version>${linkis.version}</version>
- </dependency>
-```
-**注意:** 该模块还没有deploy到中央仓库,需要在ujes/jdbc目录里面执行`mvn install
-Dmaven.test.skip=true`进行本地安装。
+</dependency>
+```
+**注意:**
该模块还没有deploy到中央仓库,需要在linkis-computation-governance/linkis-jdbc-driver目录里面执行`mvn
install -Dmaven.test.skip=true`进行本地安装。
**第二种方式通过打包和编译:**
-1. 在Linkis项目中进入到ujes/jdbc目录然后在终端输入指令进行打包`mvn assembly:assembly
-Dmaven.test.skip=true`
-该打包指令会跳过单元测试的运行和测试代码的编译,并将JDBC模块需要的依赖一并打包进Jar包之中。
-2. 打包完成后在JDBC的target目录下会生成两个Jar包,Jar包名称中包含dependencies字样的那个就是我们需要的Jar包
+1.
在Linkis项目中进入到linkis-computation-governance/linkis-jdbc-driver目录然后在终端输入指令进行打包`mvn
assembly:assembly -Dmaven.test.skip=true`
+ 该打包指令会跳过单元测试的运行和测试代码的编译,并将JDBC模块需要的依赖一并打包进Jar包之中。
+2. 打包完成后在JDBC的target目录下会生成两个Jar包,Jar包名称中包含dependencies字样的那个就是我们需要的驱动包
## 2. 建立测试类:
-建立Java的测试类LinkisClientImplTestJ,具体接口含义可以见注释:
+建立Java的测试类LinkisJDBCTest,具体接口含义可以见注释:
+
```java
- public static void main(String[] args) throws SQLException,
ClassNotFoundException {
+package org.apache.linkis.jdbc.test;
- //1. 加载驱动类:org.apache.linkis.ujes.jdbc.UJESSQLDriver
- Class.forName("org.apache.linkis.ujes.jdbc.UJESSQLDriver");
+import java.sql.*;
+
+public class LinkisJDBCTest {
- //2. 获得连接:jdbc:linkis://gatewayIP:gatewayPort 帐号和密码对应前端的帐号密码
- Connection connection =
DriverManager.getConnection("jdbc:linkis://127.0.0.1:9001","username","password");
+ public static void main(String[] args) throws SQLException,
ClassNotFoundException {
- //3. 创建statement 和执行查询
+ //1. load driver:org.apache.linkis.ujes.jdbc.UJESSQLDriver
+ Class.forName("org.apache.linkis.ujes.jdbc.UJESSQLDriver");
+
+ //2. Get
Connection:jdbc:linkis://gatewayIP:gatewayPort/dbName?EngineType=hive&creator=test,
user/password
+ Connection connection =
DriverManager.getConnection("jdbc:linkis://10.107.118.104:9001/default?EngineType=hive&creator=test","hadoop","hadoop");
+ //3. Create statement
Statement st= connection.createStatement();
ResultSet rs=st.executeQuery("show tables");
- //4.处理数据库的返回结果(使用ResultSet类)
+ //4.get result
while (rs.next()) {
ResultSetMetaData metaData = rs.getMetaData();
for (int i = 1; i <= metaData.getColumnCount(); i++) {
@@ -40,9 +46,14 @@ sidebar_position: 4
}
System.out.println();
}
- //关闭资源
+ //close resource
rs.close();
st.close();
connection.close();
}
-```
\ No newline at end of file
+}
+```
+
+备注:
+1. 其中EngineType为指定对应的引擎类型:支持Spark/hive/presto/shell等
+2. 其中creator为指定对应的应用类型,用于应用间的资源隔离
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.3.0/api/jdbc-api.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.3.0/api/jdbc-api.md
index 031c660407..637568e093 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.3.0/api/jdbc-api.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.3.0/api/jdbc-api.md
@@ -1,5 +1,5 @@
---
-title: 任务提交执行 JDBC API 文档
+title: JDBC Driver 文档
sidebar_position: 4
---
## 1. 引入依赖模块:
@@ -7,32 +7,38 @@ sidebar_position: 4
```xml
<dependency>
<groupId>org.apache.linkis</groupId>
- <artifactId>linkis-ujes-jdbc</artifactId>
+ <artifactId>linkis-jdbc-driver</artifactId>
<version>${linkis.version}</version>
- </dependency>
-```
-**注意:** 该模块还没有deploy到中央仓库,需要在ujes/jdbc目录里面执行`mvn install
-Dmaven.test.skip=true`进行本地安装。
+</dependency>
+```
+**注意:**
该模块还没有deploy到中央仓库,需要在linkis-computation-governance/linkis-jdbc-driver目录里面执行`mvn
install -Dmaven.test.skip=true`进行本地安装。
**第二种方式通过打包和编译:**
-1. 在Linkis项目中进入到ujes/jdbc目录然后在终端输入指令进行打包`mvn assembly:assembly
-Dmaven.test.skip=true`
-该打包指令会跳过单元测试的运行和测试代码的编译,并将JDBC模块需要的依赖一并打包进Jar包之中。
-2. 打包完成后在JDBC的target目录下会生成两个Jar包,Jar包名称中包含dependencies字样的那个就是我们需要的Jar包
+1.
在Linkis项目中进入到linkis-computation-governance/linkis-jdbc-driver目录然后在终端输入指令进行打包`mvn
assembly:assembly -Dmaven.test.skip=true`
+ 该打包指令会跳过单元测试的运行和测试代码的编译,并将JDBC模块需要的依赖一并打包进Jar包之中。
+2. 打包完成后在JDBC的target目录下会生成两个Jar包,Jar包名称中包含dependencies字样的那个就是我们需要的驱动包
## 2. 建立测试类:
-建立Java的测试类LinkisClientImplTestJ,具体接口含义可以见注释:
+建立Java的测试类LinkisJDBCTest,具体接口含义可以见注释:
+
```java
- public static void main(String[] args) throws SQLException,
ClassNotFoundException {
+package org.apache.linkis.jdbc.test;
- //1. 加载驱动类:org.apache.linkis.ujes.jdbc.UJESSQLDriver
- Class.forName("org.apache.linkis.ujes.jdbc.UJESSQLDriver");
+import java.sql.*;
+
+public class LinkisJDBCTest {
- //2. 获得连接:jdbc:linkis://gatewayIP:gatewayPort 帐号和密码对应前端的帐号密码
- Connection connection =
DriverManager.getConnection("jdbc:linkis://127.0.0.1:9001","username","password");
+ public static void main(String[] args) throws SQLException,
ClassNotFoundException {
- //3. 创建statement 和执行查询
+ //1. load driver:org.apache.linkis.ujes.jdbc.UJESSQLDriver
+ Class.forName("org.apache.linkis.ujes.jdbc.UJESSQLDriver");
+
+ //2. Get
Connection:jdbc:linkis://gatewayIP:gatewayPort/dbName?EngineType=hive&creator=test,
user/password
+ Connection connection =
DriverManager.getConnection("jdbc:linkis://10.107.118.104:9001/default?EngineType=hive&creator=test","hadoop","hadoop");
+ //3. Create statement
Statement st= connection.createStatement();
ResultSet rs=st.executeQuery("show tables");
- //4.处理数据库的返回结果(使用ResultSet类)
+ //4.get result
while (rs.next()) {
ResultSetMetaData metaData = rs.getMetaData();
for (int i = 1; i <= metaData.getColumnCount(); i++) {
@@ -40,9 +46,14 @@ sidebar_position: 4
}
System.out.println();
}
- //关闭资源
+ //close resource
rs.close();
st.close();
connection.close();
}
-```
\ No newline at end of file
+}
+```
+
+备注:
+1. 其中EngineType为指定对应的引擎类型:支持Spark/hive/presto/shell等
+2. 其中creator为指定对应的应用类型,用于应用间的资源隔离
diff --git a/versioned_docs/version-1.2.0/api/jdbc-api.md
b/versioned_docs/version-1.2.0/api/jdbc-api.md
index 37bba0405f..ae2a19f5dd 100644
--- a/versioned_docs/version-1.2.0/api/jdbc-api.md
+++ b/versioned_docs/version-1.2.0/api/jdbc-api.md
@@ -1,40 +1,45 @@
---
-title: Task Submission And Execution Of JDBC API
+title: Task JDBC API
sidebar_position: 4
---
-# Task Submission And Execution Of JDBC API Documents
+# Task Submission And Execution Of JDBC API
+
### 1. Introduce Dependent Modules
-The first way depends on the JDBC module in the pom:
+The first way depends on the JDBC module in the pom:
```xml
<dependency>
<groupId>org.apache.linkis</groupId>
- <artifactId>linkis-ujes-jdbc</artifactId>
+ <artifactId>linkis-jdbc-driver</artifactId>
<version>${linkis.version}</version>
</dependency>
```
-**Note:** The module has not been deployed to the central repository. You need
to execute `mvn install -Dmaven.test.skip=true` in the ujes/jdbc directory for
local installation.
+**Note:** The module has not been deployed to the central repository. You need
to execute `mvn install -Dmaven.test.skip=true` in the
linkis-computation-governance/linkis-jdbc-driver directory for local
installation.
**The second way is through packaging and compilation:**
-1. Enter the ujes/jdbc directory in the Linkis project and enter the command
in the terminal to package `mvn assembly:assembly -Dmaven.test.skip=true`
-The packaging instruction skips the running of the unit test and the
compilation of the test code, and packages the dependencies required by the
JDBC module into the Jar package.
-2. After the packaging is complete, two Jar packages will be generated in the
target directory of JDBC. The one with dependencies in the Jar package name is
the Jar package we need.
+1. Enter the linkis-jdbc-driver directory in the Linkis project and enter the
command in the terminal to package `mvn assembly:assembly
-Dmaven.test.skip=true`
+ The packaging instruction skips the running of the unit test and the
compilation of the test code, and packages the dependencies required by the
JDBC module into the Jar package.
+2. After the packaging is complete, two Jar packages will be generated in the
target directory of JDBC. The one with dependencies in the Jar package name is
the Jar package we need.
### 2. Create A Test Category
-Establish a Java test class LinkisClientImplTestJ, the specific interface
meaning can be seen in the notes:
+Establish a Java test class LinkisJDBCTest, the specific interface meaning can
be seen in the notes:
```java
- public static void main(String[] args) throws SQLException,
ClassNotFoundException {
+package org.apache.linkis.jdbc.test;
- //1. Load driver class:org.apache.linkis.ujes.jdbc.UJESSQLDriver
- Class.forName("org.apache.linkis.ujes.jdbc.UJESSQLDriver");
+import java.sql.*;
+
+public class LinkisJDBCTest {
- //2. Get connection:jdbc:linkis://gatewayIP:gatewayPort
- // the front-end account password
- Connection connection =
DriverManager.getConnection("jdbc:linkis://127.0.0.1:9001","username","password");
+ public static void main(String[] args) throws SQLException,
ClassNotFoundException {
- //3. Create statement and execute query
+ //1. load driver:org.apache.linkis.ujes.jdbc.UJESSQLDriver
+ Class.forName("org.apache.linkis.ujes.jdbc.UJESSQLDriver");
+
+ //2. Get
Connection:jdbc:linkis://gatewayIP:gatewayPort/dbName?EngineType=hive&creator=test,
user/password
+ Connection connection =
DriverManager.getConnection("jdbc:linkis://10.107.118.104:9001/default?EngineType=hive&creator=test","hadoop","hadoop");
+ //3. Create statement
Statement st= connection.createStatement();
ResultSet rs=st.executeQuery("show tables");
- //4. Processing the returned results of the database (using the
ResultSet class)
+ //4.get result
while (rs.next()) {
ResultSetMetaData metaData = rs.getMetaData();
for (int i = 1; i <= metaData.getColumnCount(); i++) {
@@ -42,9 +47,13 @@ Establish a Java test class LinkisClientImplTestJ, the
specific interface meanin
}
System.out.println();
}
- // close resourse
+ //close resource
rs.close();
st.close();
connection.close();
}
-```
\ No newline at end of file
+}
+```
+
+1. Where EngineType is the specified corresponding engine type: supports
Spark/hive/presto/shell, etc.
+2. Creator is the specified corresponding application type, which is used for
resource isolation between applications
\ No newline at end of file
diff --git a/versioned_docs/version-1.3.0/api/jdbc-api.md
b/versioned_docs/version-1.3.0/api/jdbc-api.md
index 76d16577aa..fc89ccd096 100644
--- a/versioned_docs/version-1.3.0/api/jdbc-api.md
+++ b/versioned_docs/version-1.3.0/api/jdbc-api.md
@@ -3,39 +3,43 @@ title: Task JDBC API
sidebar_position: 4
---
-# Task Submission And Execution Of JDBC API
+# Task Submission And Execution Of JDBC API
### 1. Introduce Dependent Modules
-The first way depends on the JDBC module in the pom:
+The first way depends on the JDBC module in the pom:
```xml
<dependency>
<groupId>org.apache.linkis</groupId>
- <artifactId>linkis-ujes-jdbc</artifactId>
+ <artifactId>linkis-jdbc-driver</artifactId>
<version>${linkis.version}</version>
- </dependency>
+</dependency>
```
-**Note:** The module has not been deployed to the central repository. You need
to execute `mvn install -Dmaven.test.skip=true` in the ujes/jdbc directory for
local installation.
+**Note:** The module has not been deployed to the central repository. You need
to execute `mvn install -Dmaven.test.skip=true` in the
linkis-computation-governance/linkis-jdbc-driver directory for local
installation.
**The second way is through packaging and compilation:**
-1. Enter the ujes/jdbc directory in the Linkis project and enter the command
in the terminal to package `mvn assembly:assembly -Dmaven.test.skip=true`
-The packaging instruction skips the running of the unit test and the
compilation of the test code, and packages the dependencies required by the
JDBC module into the Jar package.
-2. After the packaging is complete, two Jar packages will be generated in the
target directory of JDBC. The one with dependencies in the Jar package name is
the Jar package we need.
+1. Enter the linkis-jdbc-driver directory in the Linkis project and enter the
command in the terminal to package `mvn assembly:assembly
-Dmaven.test.skip=true`
+ The packaging instruction skips the running of the unit test and the
compilation of the test code, and packages the dependencies required by the
JDBC module into the Jar package.
+2. After the packaging is complete, two Jar packages will be generated in the
target directory of JDBC. The one with dependencies in the Jar package name is
the Jar package we need.
### 2. Create A Test Category
-Establish a Java test class LinkisClientImplTestJ, the specific interface
meaning can be seen in the notes:
+Establish a Java test class LinkisJDBCTest, the specific interface meaning can
be seen in the notes:
```java
- public static void main(String[] args) throws SQLException,
ClassNotFoundException {
+package org.apache.linkis.jdbc.test;
- //1. Load driver class:org.apache.linkis.ujes.jdbc.UJESSQLDriver
- Class.forName("org.apache.linkis.ujes.jdbc.UJESSQLDriver");
+import java.sql.*;
+
+public class LinkisJDBCTest {
- //2. Get connection:jdbc:linkis://gatewayIP:gatewayPort
- // the front-end account password
- Connection connection =
DriverManager.getConnection("jdbc:linkis://127.0.0.1:9001","username","password");
+ public static void main(String[] args) throws SQLException,
ClassNotFoundException {
- //3. Create statement and execute query
+ //1. load driver:org.apache.linkis.ujes.jdbc.UJESSQLDriver
+ Class.forName("org.apache.linkis.ujes.jdbc.UJESSQLDriver");
+
+ //2. Get
Connection:jdbc:linkis://gatewayIP:gatewayPort/dbName?EngineType=hive&creator=test,
user/password
+ Connection connection =
DriverManager.getConnection("jdbc:linkis://10.107.118.104:9001/default?EngineType=hive&creator=test","hadoop","hadoop");
+ //3. Create statement
Statement st= connection.createStatement();
ResultSet rs=st.executeQuery("show tables");
- //4. Processing the returned results of the database (using the
ResultSet class)
+ //4.get result
while (rs.next()) {
ResultSetMetaData metaData = rs.getMetaData();
for (int i = 1; i <= metaData.getColumnCount(); i++) {
@@ -43,9 +47,13 @@ Establish a Java test class LinkisClientImplTestJ, the
specific interface meanin
}
System.out.println();
}
- // close resourse
+ //close resource
rs.close();
st.close();
connection.close();
}
-```
\ No newline at end of file
+}
+```
+
+1. Where EngineType is the specified corresponding engine type: supports
Spark/hive/presto/shell, etc.
+2. Creator is the specified corresponding application type, which is used for
resource isolation between applications
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]