SQL Server 2005与java的连接。

时间:2022-12-24 13:24:09

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

需要帮助:将SQL Server2005与java连接。我把dll文件放在system32中。我正在使用sqljdbc_2.0驱动程序

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)

2 个解决方案

#1


0  

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

您正在使用集成身份验证。您是否遵循MSDN中的指令来使用集成安全性?

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

如果您指定用户名和密码,而不是连接字符串中的integratedSecurity = true,您是否连接?

#2


0  

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.

这是基于从这篇文章和MSDN收集的数据。由于潜在的问题,通常会遇到此处提供的错误。在大多数情况下,问题与java.library.path环境变量有关,JVM用它来定位要加载的任何本机库。这个环境变量可能已经由JBoss设置,其中需要将DLL的位置附加到它;如果没有,则在启动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.

现在,情况可能并非如此,因此,如果情况并非如此,建议让JBoss编写INFO和TRACE级事件。基本问题通常倾向于报告为TRACE级别日志条目。

#1


0  

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

您正在使用集成身份验证。您是否遵循MSDN中的指令来使用集成安全性?

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

如果您指定用户名和密码,而不是连接字符串中的integratedSecurity = true,您是否连接?

#2


0  

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.

这是基于从这篇文章和MSDN收集的数据。由于潜在的问题,通常会遇到此处提供的错误。在大多数情况下,问题与java.library.path环境变量有关,JVM用它来定位要加载的任何本机库。这个环境变量可能已经由JBoss设置,其中需要将DLL的位置附加到它;如果没有,则在启动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.

现在,情况可能并非如此,因此,如果情况并非如此,建议让JBoss编写INFO和TRACE级事件。基本问题通常倾向于报告为TRACE级别日志条目。