snuyanzin commented on code in PR #22758: URL: https://github.com/apache/flink/pull/22758#discussion_r1226297078
########## docs/content.zh/docs/dev/table/jdbcDriver.md: ########## @@ -0,0 +1,133 @@ +--- +title: "SQL JDBC Driver" +weight: 91 +type: docs +aliases: +- /dev/table/jdbcDriver.html +--- +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +# Flink JDBC Driver + +Flink JDBC Driver is a Java library for connecting and submitting SQL statements to [SQL Gateway]({{< ref "docs/dev/table/sql-gateway/overview" >}}) as the JDBC server. + +# Usage + +Before using Flink JDBC driver, you need to start a SQL Gateway as the JDBC server and binds it with your Flink cluster. We now assume that you have a gateway started and connected to a running Flink cluster. + +## Use with a JDBC Tool +### Use with Beeline + +Beeline is the command line tool for accessing [Apache Hive](https://hive.apache.org/), but it also supports general JDBC drivers. To install Hive and beeline, see [Hive documentation](https://cwiki.apache.org/confluence/display/Hive/GettingStarted#GettingStarted-RunningHiveServer2andBeeline.1). + +1. Download flink-jdbc-driver-bundle-{VERSION}.jar and add it to `$HIVE_HOME/lib`. +2. Run beeline and connect to a Flink SQL gateway. As Flink SQL gateway currently ignores user names and passwords, just leave them empty. + ``` + beeline> !connect jdbc:flink://localhost:8083 + ``` +3. Execute any statement you want. Review Comment: There is a much lighter brother-twilling tool https://github.com/julianhyde/sqlline commands about connect, property set and others are same (almost same) for both they are both forks of the same initial tool however beeline has lots of hive dependencies while sqlline is agnostic Do you mind to add docs for sqlline (also comes/used in Apache Calcite) ? Moreover it has a number of features like syntax highlighting, autocompeteion, line numbers and so on demo of some of them could be found at https://github.com/julianhyde/sqlline/wiki/Demos -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
