I have a working JNDI
with SQL server username and password in my Java application. It throws NameNotFoundException
when I try to change the user to my domain user instead of SQL user.
Here it is mentioned I only have to provide integratedSecurity
as true. Have I missed anything in my JNDI?
JNDI with SQL Server User:
<Resource
name="jdbc/MyJNDI"
auth="Container"
type="javax.sql.DataSource"
maxTotal="100"
maxIdle="30"
maxWaitMillis="1000"
validationQuery="select 1"
testOnBorrow="true"
testOnConnect="true"
testOnReturn="true"
testWhileIdle="true"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
url="jdbc:sqlserver://localhost:1433;database=survey;user=myuser;password=mypassword;"
/>
My JNDI with domain user:
<Resource
name="jdbc/MyJNDI"
auth="Container"
type="javax.sql.DataSource"
maxTotal="100"
maxIdle="30"
maxWaitMillis="1000"
validationQuery="select 1"
testOnBorrow="true"
testOnConnect="true"
testOnReturn="true"
testWhileIdle="true"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
url="jdbc:sqlserver://localhost:1433;database=survey;integratedSecurity=true;"
/>
Another driver is necessary. See this source http://www.bigdata-unleashed.com/20150930/database-ntlm-authentifizierung
Database driver is available at http://sourceforge.net/projects/jtds/files/jtds/