Skip to content

Commit 43ebe78

Browse files
committed
KTOR-3419 Add sample with Postgres JDBC
1 parent 1aa7aff commit 43ebe78

File tree

1 file changed

+1
-1
lines changed
  • postgres/src/main/kotlin/com/example/plugins

1 file changed

+1
-1
lines changed

postgres/src/main/kotlin/com/example/plugins/Routing.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ fun Application.configureRouting() {
7070
fun Application.connectToPostgres(embedded: Boolean): Connection {
7171
Class.forName("org.postgresql.Driver")
7272
if (embedded) {
73-
return DriverManager.getConnection("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1", "root", "")
73+
return DriverManager.getConnection("jdbc:postgresql://localhost/test;DB_CLOSE_DELAY=-1", "root", "")
7474
} else {
7575
val url = environment.config.property("postgres.url").getString()
7676
val user = environment.config.property("postgres.user").getString()

0 commit comments

Comments
 (0)