java.sql.SQLException:Listener refused the connection with the following error:ORA-12505,TNS:lisjava.sql.SQLException:Listener refused the connection with the following error:ORA-12505,TNS:listener does not currently know of SID given in connect desc

来源:学生作业帮助网 编辑:作业帮 时间:2024/07/20 11:18:29
java.sql.SQLException:Listener refused the connection with the following error:ORA-12505,TNS:lisjava.sql.SQLException:Listener refused the connection with the following error:ORA-12505,TNS:listener does not currently know of SID given in connect desc
xW{OV*W$R&ٌV[haI2 璸5gJt ka@7<ʇ턿vp톦iP9ys9iTN_9FRdA+ KᘠX*RqOHb˒yGi=(AXUe5O4} jڒaQЎ¤e!IߧX!tU܃-Qd7v'<0bcPEUӑr+nI 2H#YUH`J{vHxNt6*2N}D]R *I\*Q_6Ժ0YHSAJ.r"I O~$xPXewAAC Qa,I`EV+Q)h{{JAžYC&LDuܔl+k_G0h`]yiГo/&D]eۀ!"0dgr/HwhY)]ի\dg W2L*b.mk8G̃ED8{ ;4 q0vh;,%}#9p3x:- ÄjQ/^ܞfV̹#NӋ s|uњ37ͥ-Ƽbl,{4 5FU5Fgw S`L-n[L M4_B5^ck O+7m7Uk"g3Gs(~quw Y3wf*.̱ #?NSΗN)>^.b7bmmiIUc5Hj܂lу~V ꊵ$S&)*SZMF\4ʢS=tZ?TW*;,/SES喀G]q[}iO'Zˆ=-x۾Իx5E 6{t*.H#WKE81͉T=tXaQ%\Yܞ,.)l<ÝY 6{8޳[N9Zl!(̛;}(# w؅ ,gBާn,عuǺ7 PИɒa%0fY~s, Z*n=|e6MLxil9Ng ey#̭QOg9-W{؄X$0έ Xw2 .d

java.sql.SQLException:Listener refused the connection with the following error:ORA-12505,TNS:lisjava.sql.SQLException:Listener refused the connection with the following error:ORA-12505,TNS:listener does not currently know of SID given in connect desc
java.sql.SQLException:Listener refused the connection with the following error:ORA-12505,TNS:lis
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
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:412)
at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:531)
at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:221)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:503)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:62)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by:oracle.net.ns.NetException:Listener refused the connection with the following error:
ORA-12505,TNS:listener does not currently know of SID given in connect descriptor
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:385)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1042)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:301)
...25 more

java.sql.SQLException:Listener refused the connection with the following error:ORA-12505,TNS:lisjava.sql.SQLException:Listener refused the connection with the following error:ORA-12505,TNS:listener does not currently know of SID given in connect desc
这是因为oracle 服务没有建好.可以在菜单net manager打开 新建一个服务.然后用这个服务登录.

计算机软件的知识
数据库异常 监听拒绝这个连接 显错

找到这个目前下。
D:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN
用记事本打开 listener.ora 文件;文件如下:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)...

全部展开

找到这个目前下。
D:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN
用记事本打开 listener.ora 文件;文件如下:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = D:\oraclexe\app\oracle\product\11.2.0\server)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = D:\oraclexe\app\oracle\product\11.2.0\server)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = 0HRTOR4KLCB9KTG)(PORT = 1521))
)
)
DEFAULT_SERVICE_LISTENER = (XE)
最后我在 eclipse 把SID 修改成最后那两位数:XE
代码如下:
public class testjdbc {
public static void main(String[] args) throws Exception {
Class.forName("oracle.jdbc.driver.OracleDriver");
String url = "jdbc:oracle:thin:@localhost:1521:xe";
String user = "XXX";
String password = "XXX";
Connection con=DriverManager.getConnection(url, user, password);
System.out.println(con);
}
}
最后运行结果:oracle.jdbc.driver.T4CConnection@1813fac

收起

这是计算机数据库问题,翻译成中文也没用,可以到计算机数据库分类里提问。java与数据库连接问题。jdbc提供了java与数据库的连接方法,具体问题还是找数据库专家提问吧

服务器连接问题,因该是服务没有开启吧,你先把服务重新启动,试试