jdbc.SQLServerException: Login failed for user for any user

后端 未结 4 838
你的背包
你的背包 2021-01-04 23:55

I trying to test the connection with my local sql DB. I have this code:

try{
    Class.forName(\"com.microsoft.sqlserver.jdbc.SQLServerDriver\").newInstance(         


        
4条回答
  •  我在风中等你
    2021-01-05 00:19

    Re: Did it. still WARNING: Failed to load the sqljdbc_auth.dll cause :- no sqljdbc_auth in java.library.path – Mike Oct 7 at 14:03

    you have to add the path to sqljdbc_auth.dll by adding this under VM arguments in Eclipse or commandline if you're running from the shell: -Djava.library.path="\MS SQL Server JDBC Driver 3.0\sqljdbc_3.0\enu\auth\x86"

    that's if you're running 32 bit Windows. else the final subdir changes accordingly.

    I think this might be a better answer though, to setting up SQL Server user based authentication: Connecting SQL Server 2008 to Java: Login failed for user error

    (I try to summarize it here: http://silveira.wikidot.com/sql-server)

提交回复
热议问题