Database connection


#1

Hi,

I want to connect to a mysql database. Where can I find the API details of Kotlin for Db connection?

I am new to Kotlin.


#2

To connect to a database, you use exactly the same JDBC API as in Java.


#3

@yole Can you help me out with some samples or some link which uses Kotlin with JDBC for DB connection?


#4

You can use any Java JDBC tutorial (for example, the official Oracle one) and use the Java to Kotlin converter tool (Code | Convert Java File to Kotlin File in IntelliJ IDEA) to convert it to Kotlin.


#5

Thanks yole