用java连接不上sqlserver2008,用客户端studio和.net程序都能连,郁闷~~~who can help me~~~
java 配置
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName"><value>com.microsoft.sqlserver.jdbc.SQLServerDriver</value></property>
<property name="url"><value>jdbc:sqlserver://xxx.xxx.xxx.xx:3433; DatabaseName=xxxx</value></property>
<property name="username"><value>xx</value></property>
<property name="password"><value>xxxxxx</value></property>
<property name="validationQuery"><value>select 1</value></property>
</bean>
报错信息
12-01 14:38:17.602 WARN [JDBCExceptionReporter.java:57] SQL Error: 0, SQLState:
08S01
12-01 14:38:17.602 ERROR [JDBCExceptionReporter.java:58] The connection to the h
ost RDS151012562, named instance MS3032 has failed. Error: java.net.UnknownHostE
xception: RDS151012562. Please verify the server and instance names, check that
no firewall is blocking UDP traffic to port 1434, and for SQL Server 2005 or lat
er, verify that the SQL Server Browser service is running on the host.
12-01 14:38:17.602 WARN [SettingsFactory.java:107] Could not obtain connection
metadata
com.microsoft.sqlserver.jdbc.SQLServerException: The connection to the host RDS1
51012562, named instance MS3032 has failed. Error: java.net.UnknownHostException
: RDS151012562. Please verify the server and instance names, check that no firew
all is blocking UDP traffic to port 1434, and for SQL Server 2005 or later, veri
fy that the SQL Server Browser service is running on the host.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(S
QLServerException.java:130)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.getInstancePort(SQLS
erverConnection.java:3090)
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。