java连接不上sqlserver2008help-问答-阿里云开发者社区-阿里云

开发者社区> 问答> 正文

java连接不上sqlserver2008help

jeff1709 2014-12-01 15:57:40 10623
用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)

SQL Java 数据库连接
分享到
取消 提交回答
全部回答(3)
  • 小柒2012
    2015-08-14 20:10:33
    回 2楼(icepoint) 的帖子
    端口不应该是1434嘛 难道自己改过
    0 0
  • icepoint
    2015-08-13 15:15:44
    Rejava连接不上sqlserver2008help
    碰到同样问题了,楼主问题解决了吗?
    0 0
  • rds-pd
    2014-12-03 10:15:37
    回 楼主(jeff1709) 的帖子
    可能是jdbc驱动的问题,建议你更新一下jdbc驱动再试试。
    0 0
添加回答
数据库
使用钉钉扫一扫加入圈子
+ 订阅

分享数据库前沿,解构实战干货,推动数据库技术变革

推荐文章
相似问题
推荐课程