2013-01-22 3 views
0

Eclipse에서 jdbc 연결을 열면 제대로 작동합니다.Java JDBC 연결 내 Eclipse의 통합 보안 작업

하지만 실행 가능한 jar 파일을 만들고 실행하면 통합 보안 문제가 발생합니다.

나 ...뿐만 아니라 통합 보안과 함께 할 수

+0

예외 또는 일부 코드를 표시 할 수 있습니까? – Thilo

+0

sqlserver db jar의 최신 버전을 다운로드하십시오. 이전 버전에서는 통합 보안이 처리되지 않은 곳을 들었습니다! – madhairsilence

+0

주요 문제 : 내 progam 일식에서 작동하지만 명령 줄에서 jdbc 드라이버를 사용할 수 없습니다 –

답변

1

난 당신이 마이크로 소프트 SQL 서버에 연결하는 방법에 대한 이야기 ​​가정입니다.

The JDBC driver supports the use of Type 2 integrated authentication on Windows operating systems through the integratedSecurity connection string property. To use integrated authentication, copy the sqljdbc_auth.dll file to a directory on the Windows system path on the computer where the JDBC driver is installed.

The sqljdbc_auth.dll files are installed in the following location:

<installation directory>\sqljdbc_<version>\<language>\auth\

[...]

Alternatively you can set the java.libary.path system property to specify the directory of the sqljdbc_auth.dll . For example, if the JDBC driver is installed in the default directory, you can specify the location of the DLL by using the following virtual machine (VM) argument when the Java application is started:

-Djava.library.path=C:\Microsoft JDBC Driver 4.0 for SQL Server\sqljdbc_<version>\enu\auth\x86

것은 당신이 (32 비트에 대한 귀하의 자바 VM의 비트 수에 따라 올바른 DLL을 사용할 필요가 있음을 유의하십시오 http://msdn.microsoft.com/en-us/library/ms378428.aspx#Connectingintegrated에 설명 된대로 당신은 java.library.pathsqljdbc_auth.dll를 추가 할 필요가 통합 보안을 사용할 수 있도록 , 하나는 x86이고, 64 비트는 x64입니다.

+0

당신은 rigth입니다 - 그것은 권한에 관한 것입니다. 지금 나는 당신의 대답을 사용하려고 노력합니다. –

+0

첫 번째 : 나는 그와 같은 dir : SQL Server \ sqljdbc_ \ enu \ auth \ x86 C : \ Microsoft JDBC 드라이버 4.0 –

+0

그래서 무슨 소리 야? –