1.7 KiB
Vendored
SQL
Work with SQL databases in Kotlin using DataFrame and JDBC — read tables and queries with ease. Connect to PostgreSQL, MySQL, SQLite, and other SQL databases using Kotlin DataFrame's JDBC support. Load data from SQL databases into Kotlin DataFrame using JDBC and built-in reading functions.Kotlin DataFrame supports reading from SQL databases using JDBC.
Requires the dataframe-jdbc module,
which is included by default in the general dataframe artifact
and in %use dataframe for Kotlin Notebook.
You’ll also need a JDBC driver for the specific database.
Supported databases
Kotlin DataFrame provides out-of-the-box support for the most common SQL databases:
You can also define a Custom SQL Source to work with any other JDBC-compatible database.
Read
DataFrame can be loaded from a database in several ways:
a user can read data from a SQL table by given name (readSqlTable),
as a result of a user-defined SQL query (readSqlQuery),
or from a given ResultSet (readResultSet).
It is also possible to load all data from non-system tables, each into a separate DataFrame
(readAllSqlTables).