add Database linking template

main
Thomas BREIL 2023-09-18 17:21:22 +02:00
parent c9ed0edbaa
commit 6232d8df51
1 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,15 @@
import java.sql.DriverManager
// the model class
data class User(val id: Int, val name: String)
fun main(){
val connection = DriverManager.getConnection(
"jdbc:mysql://localhost:3306/sae",
"root", "0000");
// prints true if the connection is valid
println(connection.isValid(0))
}