2 u014342844 u014342844 于 2015.06.25 13:09 提问

ssh 连接报错,求帮忙解答一下 。谢谢

org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: Cannot open connection; uncategorized SQLException for SQL [???]; SQL state [null]; error code [0]; Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
The Connection descriptor used by the client was:
localhost:1521:XE
; nested exception is java.sql.SQLException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
The Connection descriptor used by the client was:
localhost:1521:XE
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)
at org.springframework.orm.hibernate3.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:424)
at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:410)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411)
at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
at org.springframework.orm.hibernate3.HibernateTemplate.save(HibernateTemplate.java:683)
at com.dao.impl.RegisterDaoImpl.register(RegisterDaoImpl.java:14)
at com.biz.impl.RegisterBizImpl.register(RegisterBizImpl.java:17)
at com.action.RegisterAction.register(RegisterAction.java:13)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:450)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:289)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:252)

3个回答

chunlan0912
chunlan0912   2015.06.25 14:22
已采纳

你的数据库配置有问题。数据库,端口的SID是多少呢? 你的报错信息,显示是"localhost:1521:XE" 。数据库配置基本上就是驱动、ip、端口、用户名和密码,把这些确认一下,基本都能连接上数据库。

u014342844
u014342844 谢谢 , 就是这句错了
2 年多之前 回复
caozhy
caozhy   Ds   Rxr 2015.06.25 13:13
YanXunZhuang_10231
YanXunZhuang_10231   2015.06.25 15:02

端口或是密码是不是正确,数据库监听是不是开启

Csdn user default icon
上传中...
上传图片
插入图片