Skip to content

Commit

Permalink
[KYUUBI apache#5347] [DOCS] Fix java code errors in quick_start_with_…
Browse files Browse the repository at this point in the history
…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 apache#5347 from mrtisttt/fix-hive-jdbc-example-code.

Closes apache#5347

ec6ecf7 [mrtisttt] [DOCS] Fix java code errors in quick_start_with_jdbc

Authored-by: mrtisttt <mrtisttt@126.com>
Signed-off-by: Fu Chen <cfmcgrady@gmail.com>
  • Loading branch information
mrtisttt authored and cfmcgrady committed Oct 6, 2023
1 parent 57b6773 commit 42f9c7c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/quick_start/quick_start_with_jdbc.md
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down Expand Up @@ -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));
}
Expand Down

0 comments on commit 42f9c7c

Please sign in to comment.