Search code examples
sql-serverjdbcglassfish-3

Glassfish 3.1 JDBC Connection Pool to MS SQL Server 2012 named instance


i'm trying to add a jdbc connection pool -- within glassfish 3.1.2 running on windows -- to a mssql server 2012 named instance. so i made the usual settings, such as, user, password, databaseName, url, and serverName.

however, as this is a named instance, i have to provide the name of the instance somewhere. so i tried to add an additional attribute instanceName, to no avail. providing the fully quallified url -- with ip, instanceName, user, ... didn't succeed either.

all the attempts resulted in an error message that the user X -- that i used in the properties -- can't be authenticated. the error message is logged on the default instance, not on the instance i tried to connect to.

in the general settings i chose javax.sql.XADatasource -- though i tried it with the plain DataSource as well -- as the ResourceType, and com.microsoft.sqlserver.jdbc.SQLServerDataSource as the Datasource Classname.

appreciate your feedback

EDIT:

here are the fields -- Additional Properties:

InstanceName = WEB
ServerName   = <DB_SERVER_IP>
DatabaseName = FooDB
User         = <USER_X>
Password     = <USER_X_PASSWORD>
URL          = jdbc:sqlserver://

Solution

  • the secret is -- i know i left out that property --, to not to have the port property set.