add Database linking template
parent
c9ed0edbaa
commit
6232d8df51
|
@ -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))
|
||||||
|
}
|
Loading…
Reference in New Issue