1.No suitable driver found for Jdbc:
1)确保jdbc:sqlserver://localhost;user=sa;password=123456;database=learn正确
2)确保connection,perpareStatement等语句正确
3)确保当前项目加入合适的sqljdbc.jar
4)将sqljdbc.jar的jar包加入C:Program FilesJavajre1.6.0_02libext文件夹下
2.通过端口 1433 连接到主机 localhost 的 TCP/IP 连接失败:
1)确保防火墙没有阻止
2)确保sql server网络配置下的TCP/IP协议打开(在sql server configuration manager)
3)确保重启sql server mssqlserver服务(在sql server configuration manager)