You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to connect to Azure SQL database (using Microsoft SQL server jdbc).
I can get working connection with java.sql.DriverManager: conn = DriverManager.getConnection(dbFullAddress, dbUser, dbPassword)
However, trying to connect using Exposed results in "Connection closed":
The connection is closed.
com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:234)
at com.microsoft.sqlserver.jdbc.SQLServerDatabaseMetaData.checkClosed(SQLServerDatabaseMetaData.java:172)
at com.microsoft.sqlserver.jdbc.SQLServerDatabaseMetaData.getURL(SQLServerDatabaseMetaData.java:1442)
at org.jetbrains.exposed.sql.Database$url$2.invoke(Database.kt:27)
at org.jetbrains.exposed.sql.Database$url$2.invoke(Database.kt:16)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at org.jetbrains.exposed.sql.Database.getUrl(Database.kt)
at org.jetbrains.exposed.sql.Database$dialect$2.invoke(Database.kt:30)
at org.jetbrains.exposed.sql.Database$dialect$2.invoke(Database.kt:16)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at org.jetbrains.exposed.sql.Database.getDialect(Database.kt)
.......
implementation("com.microsoft.sqlserver:mssql-jdbc:7.2.2.jre8")
implementation("org.jetbrains.exposed:exposed:0.14.3")
private val dbUser = "user"
private val dbPassword ="password"
private val dbFullAddress = "jdbc:sqlserver://db-prefix.database.windows.net:1433;databaseName=dbname;authentication=SqlPassword"
private var db : Database
init {
val db = Database.connect(dbFullAddress, "com.microsoft.sqlserver.jdbc.SQLServerDriver",
user = dbUser, password = dbPassword)
print(db.name)
}
I tried different combinations of "authentication" parameter but nothing worked/
I use openjdk:
OpenJDK Runtime Environment (build 1.8.0_212-8u212-b03-0ubuntu1.18.04.1-b03)
OpenJDK 64-Bit Server VM (build 25.212-b03, mixed mode)
The text was updated successfully, but these errors were encountered:
I'm trying to connect to Azure SQL database (using Microsoft SQL server jdbc).
I can get working connection with java.sql.DriverManager:
conn = DriverManager.getConnection(dbFullAddress, dbUser, dbPassword)
However, trying to connect using Exposed results in "Connection closed":
I tried different combinations of "authentication" parameter but nothing worked/
I use openjdk:
OpenJDK Runtime Environment (build 1.8.0_212-8u212-b03-0ubuntu1.18.04.1-b03)
OpenJDK 64-Bit Server VM (build 25.212-b03, mixed mode)
The text was updated successfully, but these errors were encountered: