This is an automated email from the ASF dual-hosted git repository.
fchen pushed a commit to branch branch-1.7
in repository https://gitbox.apache.org/repos/asf/kyuubi.git
The following commit(s) were added to refs/heads/branch-1.7 by this push:
new 70b95b49e [KYUUBI #5347] [DOCS] Fix java code errors in
quick_start_with_jdbc
70b95b49e is described below
commit 70b95b49ed7f112b74a39496116703c9b073bf8c
Author: mrtisttt <[email protected]>
AuthorDate: Fri Oct 6 11:18:28 2023 +0800
[KYUUBI #5347] [DOCS] Fix java code errors in quick_start_with_jdbc
### _Why are the changes needed?_
There were obvious errors in the case code, so these cases were fixed.
### _How was this patch tested?_
Just fix case code, no test need. Of course, I have run the case code and
have confirmed that there is no problem.
Closes #5347 from mrtisttt/fix-hive-jdbc-example-code.
Closes #5347
ec6ecf758 [mrtisttt] [DOCS] Fix java code errors in quick_start_with_jdbc
Authored-by: mrtisttt <[email protected]>
Signed-off-by: Fu Chen <[email protected]>
(cherry picked from commit 42f9c7c921fd17d4ccc47a117064ed5341851726)
Signed-off-by: Fu Chen <[email protected]>
---
docs/quick_start/quick_start_with_jdbc.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/docs/quick_start/quick_start_with_jdbc.md
b/docs/quick_start/quick_start_with_jdbc.md
index 862e22fa1..bb2d65127 100644
--- a/docs/quick_start/quick_start_with_jdbc.md
+++ b/docs/quick_start/quick_start_with_jdbc.md
@@ -50,7 +50,7 @@ public class KyuubiJDBC {
public static void main(String[] args) throws SQLException {
try (Connection conn = DriverManager.getConnection(kyuubiJdbcUrl)) {
try (Statement stmt = conn.createStatement()) {
- try (ResultSet rs = st.executeQuery("show databases")) {
+ try (ResultSet rs = stmt.executeQuery("show databases")) {
while (rs.next()) {
System.out.println(rs.getString(1));
}
@@ -79,11 +79,11 @@ public class KyuubiJDBCDemo {
public static void main(String[] args) throws SQLException {
String clientPrincipal = args[0]; // Kerberos principal
String clientKeytab = args[1]; // Keytab file location
- String serverPrincipal = arg[2]; // Kerberos principal used by Kyuubi
Server
+ String serverPrincipal = args[2]; // Kerberos principal used by Kyuubi
Server
String kyuubiJdbcUrl = String.format(kyuubiJdbcUrlTemplate,
clientPrincipal, clientKeytab, serverPrincipal);
try (Connection conn = DriverManager.getConnection(kyuubiJdbcUrl)) {
try (Statement stmt = conn.createStatement()) {
- try (ResultSet rs = st.executeQuery("show databases")) {
+ try (ResultSet rs = stmt.executeQuery("show databases")) {
while (rs.next()) {
System.out.println(rs.getString(1));
}