2020-04-03 13:23:32 +00:00
|
|
|
---
|
|
|
|
toc_priority: 43
|
|
|
|
toc_title: jdbc
|
|
|
|
---
|
|
|
|
|
2020-03-21 04:11:51 +00:00
|
|
|
# jdbc {#table-function-jdbc}
|
2018-10-16 10:47:17 +00:00
|
|
|
|
|
|
|
`jdbc(jdbc_connection_uri, schema, table)` - returns table that is connected via JDBC driver.
|
|
|
|
|
|
|
|
This table function requires separate `clickhouse-jdbc-bridge` program to be running.
|
|
|
|
It supports Nullable types (based on DDL of remote table that is queried).
|
|
|
|
|
|
|
|
**Examples**
|
|
|
|
|
2020-03-20 10:10:48 +00:00
|
|
|
``` sql
|
2018-10-16 10:47:17 +00:00
|
|
|
SELECT * FROM jdbc('jdbc:mysql://localhost:3306/?user=root&password=root', 'schema', 'table')
|
|
|
|
```
|
|
|
|
|
2020-03-20 10:10:48 +00:00
|
|
|
``` sql
|
2018-10-16 10:47:17 +00:00
|
|
|
SELECT * FROM jdbc('mysql://localhost:3306/?user=root&password=root', 'schema', 'table')
|
|
|
|
```
|
|
|
|
|
2020-03-20 10:10:48 +00:00
|
|
|
``` sql
|
2018-10-16 10:47:17 +00:00
|
|
|
SELECT * FROM jdbc('datasource://mysql-local', 'schema', 'table')
|
|
|
|
```
|
|
|
|
|
2020-01-30 10:34:55 +00:00
|
|
|
[Original article](https://clickhouse.tech/docs/en/query_language/table_functions/jdbc/) <!--hide-->
|