我已经将数据库驱动放在了classpath中了,但是怎么还出现下面的错误: java.sql.SQLException: [Microsoft][SQLServer JDBC Driver]Error establishing sock et. at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source) at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source) at com.microsoft.jdbc.sqlserver.tds.TDSConnection.<init>(Unknown Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown Sou rce) at com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown S ource) at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source) at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source) at java.sql.DriverManager.getConnection(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:171) at CreatTableTest.getConnection(CreatTableTest.java:103) at CreatTableTest.main(CreatTableTest.java:28) Exception in thread "main" java.lang.NullPointerException at CreatTableTest.createTable(CreatTableTest.java:41) at CreatTableTest.main(CreatTableTest.java:29) 那位高手能帮小弟解决一下这个难题!谢谢!
----------------解决方案--------------------------------------------------------