简体   繁体   中英

SQL Server 2005 connection with java.

Needed help : connecting SQL Server2005 with java. I had put the dll file in system32. I'm using sqljdbc_2.0 drivers

02:29:11,937 ERROR [STDERR] com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication.
02:29:11,937 ERROR [STDERR]     at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:170)
02:29:11,937 ERROR [STDERR]     at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:2338)
02:29:11,937 ERROR [STDERR]     at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:1929)
02:29:11,937 ERROR [STDERR]     at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$000(SQLServerConnection.java:41)
02:29:11,937 ERROR [STDERR]     at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:1917)
02:29:11,937 ERROR [STDERR]     at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4026)
02:29:11,937 ERROR [STDERR]     at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1416)
02:29:11,937 ERROR [STDERR]     at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1061)
02:29:11,937 ERROR [STDERR]     at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:833)
02:29:11,937 ERROR [STDERR]     at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:716)
02:29:11,937 ERROR [STDERR]     at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:841)
02:29:11,937 ERROR [STDERR]     at java.sql.DriverManager.getConnection(Unknown Source)
02:29:11,937 ERROR [STDERR]     at java.sql.DriverManager.getConnection(Unknown Source)
02:29:11,937 ERROR [STDERR]     at com.product.DAO.userDAOImpl.GetRemotePID(userDAOImpl.java:10029)
02:29:11,937 ERROR [STDERR]     at com.product.DAO.userDAOImpl.getServiceList(userDAOImpl.java:8191)
02:29:11,937 ERROR [STDERR]     at com.product.action.BillGenerationAction.execute(BillGenerationAction.java:272)
02:29:11,937 ERROR [STDERR]     at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
02:29:11,937 ERROR [STDERR]     at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
02:29:11,937 ERROR [STDERR]     at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
02:29:11,937 ERROR [STDERR]     at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
02:29:11,937 ERROR [STDERR]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
02:29:11,937 ERROR [STDERR]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
02:29:11,937 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
02:29:11,937 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
02:29:11,937 ERROR [STDERR]     at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
02:29:11,937 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
02:29:11,937 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
02:29:11,937 ERROR [STDERR]     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
02:29:11,937 ERROR [STDERR]     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
02:29:11,937 ERROR [STDERR]     at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
02:29:11,937 ERROR [STDERR]     at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
02:29:11,937 ERROR [STDERR]     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
02:29:11,937 ERROR [STDERR]     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
02:29:11,937 ERROR [STDERR]     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
02:29:11,937 ERROR [STDERR]     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
02:29:11,937 ERROR [STDERR]     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
02:29:11,937 ERROR [STDERR]     at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
02:29:11,937 ERROR [STDERR]     at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
02:29:11,937 ERROR [STDERR]     at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
02:29:11,937 ERROR [STDERR]     at java.lang.Thread.run(Unknown Source)

You're using integrated authentication. Did you follow instruction in MSDN to use integrated security?

If you specify a username and a password, instead of integratedSecurity=true in the connection string do you get connected?

This is based on data gleaned from all over this post and from MSDN. The error presented here is typically encountered due to an underlying issue. In most cases, the problem has to do with the java.library.path environment variable that is used by the JVM to locate any native libraries to be loaded. This environment variable may already be set by JBoss, in which one needs to append the location of the DLL to it; if not, the environment variable needs to be set when starting JBoss.

Now, this might not be the case, and therefore, it is recommended to get JBoss to write INFO and TRACE level events if that is not the case. The underlying issue typically tends to be reported as a TRACE level log entry.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM