khac phuc mot so loi thuong gap tren java khi ket noi csdl

13 1.1K 0
khac phuc mot so loi thuong gap tren java khi ket noi csdl

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Khi kết nối Java đến SQL Server sẽ có thể gặp phải một số lỗi: java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver: Chưa build path thư viện Java Runtime Environment (JRE) version 1.8 is not supported by this driver. Use the sqljdbc4.jar class library, which provides support for JDBC 4.0.: thêm nhầm thư viện sqljdbc.jar. Phải thêm file sqljdbc4.jar, sqljdbc41.jar, sqljdbc42.jar,...  

Khi kết nối Java đến SQL Server gặp phải số lỗi: - java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver: Chưa build path thư viện - Java Runtime Environment (JRE) version 1.8 is not supported by this driver Use the sqljdbc4.jar class library, which provides support for JDBC 4.0.: thêm nhầm thư viện sqljdbc.jar Phải thêm file sqljdbc4.jar, sqljdbc41.jar, sqljdbc42.jar, - com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host localhost1, port 1433 has failed Error: "connect timed out Verify the connection properties Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port Make sure that TCP connections to the port are not blocked by a firewall." Lỗi nhiều nguyên nhân: + Sai url localhost + Sai port (mặc định 1433), port config Server: Vào "SQL Server Configuration Manager" > "SQL Server Network Configuration" > "Protocols for MSSQLSERVER" > "TCP/IP" > "IP Addresses" > "IPAll" để xem port config Hoặc port mặc định bị tường lửa chặn không cho hoạt động Để thiết lập lại tường lửa: "Windows + R" > "WF.msc" > "Inbound Rules" > "Add Rules" (theo hướng dẫn đây: https://msdn.microsoft.com/en-us/library/ms175043.aspx) + TCP/IP Protocol SQL Server Network Configuration chưa Enable Vào "SQL Server Configuration Manager" > "SQL Server Network Configuration" > "Protocols for MSSQLSERVER" > "TCP/IP" > Enable - com.microsoft.sqlserver.jdbc.SQLServerException: Cannot open database "NgocKhuong" requested by the login The login failed Không tìm thấy database config server (Ví dụ NgocKhuong) - Failed to load the sqljdbc_auth.dll cause : no sqljdbc_auth in java.library.path com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication: Từ phiên sqljdbc_6.0 phải cần thêm thư viện sqljdbc_auth để kết nối đến sql server phương thức xác nhận không cần username & password server Để kết nối, cần copy file sqljdbc_auth.dll vào thư mục C:\Windows\System32 Hoặc set java path cho thư viện sau: -Djava.library.path=C:\bla\path\where\the\dll\is Ví dụ: "-Djava.library.path=C:\Program Files (x86)\jdbc\sqljdbc_4.0\enu\auth\x86" [...]... sqljdbc_auth in java. library.path com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication: Từ phiên bản sqljdbc_6.0 thì phải cần thêm thư viện sqljdbc_auth để mới có thể kết nối đến sql server bằng phương thức xác nhận không cần username & password server Để kết nối, cần copy file sqljdbc_auth.dll vào thư mục C:\Windows\System32 Hoặc có thể set java path... "WF.msc" > "Inbound Rules" > "Add Rules" (theo hướng dẫn tại đây: https://msdn.microsoft.com/en-us/library/ms175043.aspx) + TCP/IP Protocol trong SQL Server Network Configuration chưa được Enable Vào "SQL Server Configuration Manager" > "SQL Server Network Configuration" > "Protocols for MSSQLSERVER" > "TCP/IP" > Enable - com.microsoft.sqlserver.jdbc.SQLServerException: Cannot open database "NgocKhuong" requested... xác nhận không cần username & password server Để kết nối, cần copy file sqljdbc_auth.dll vào thư mục C:\Windows\System32 Hoặc có thể set java path cho thư viện đó như sau: -Djava.library.path=C:\bla\path\where\the\dll\is Ví dụ: "-Djava.library.path=C:\Program Files (x86)\jdbc\sqljdbc_4.0\enu\auth\x86" ... - com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host localhost1, port 1433 has failed Error: "connect timed out Verify the connection properties Make sure that an instance of SQL Server

Ngày đăng: 05/06/2016, 09:16

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan