與Java MicrosoftSqlServer 2005的java連接至2005 MicrosoftSQLServer
- IDE使用連接:Eclipse的赫利俄斯使用
- 驅動程序:sqljdbc.jar
- .dll文件中:從x86文件夾sqljdbc_auth.dll。
- .dll被添加到system32文件夾重新啓動系統。
- 平安成功與SQL Server 2005連接使用Eclipse sqljdbc.jar
錯誤報告:
15:45:48,218 ERROR [STDERR] Jan 28, 2011 3:45:48 PM com.microsoft.sqlserver.jdbc.AuthenticationJNI <clinit>
WARNING: Failed to load the sqljdbc_auth.dll
15:46:02,671 ERROR [STDERR] com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host localhost, port 1433 has failed. Error: "connect timed out. Verify the connection properties, check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.".
您好所有,
我已經執行這命令提示符:I'M立即獲取此錯誤:
C:\>java -cp .;"C:\sqljdbc_1.2\enu\sqljdbc.jar" -Djava.library.path="C:\sqljdbc_
1.2\enu\auth\x86" mfirst
Exception in thread "main" java.lang.NoClassDefFoundError: mfirst
Caused by: java.lang.ClassNotFoundException: mfirst
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: mfirst. Program will exit.
驗證了這一點:「連接屬性,檢查SQL Server的一個實例是否在主機上運行,並且在端口上接受TCP/IP連接,並且沒有防火牆阻止TCP連接到端口。 – 2011-01-28 10:34:27