Tengo un problema a la hora de conectarme desde java a una base de datos Oracle.
La version que estoy usando, y que no me ha dejado de dar problemas y que terminare odiando es Oracle 11g R2.
Pues bien, hace unos dias con el codigo que tenia tal cual funcionaba, se conectaba a la Base de datos e insertaba/eliminaba entradas en la base de datos. Al dia siguiente me dejo de funcionar oracle, no se muy bien como pues deje el ordenador encendido y ni lo apage ni nada, ni un mal cerrado, y ya no me dejaba entrar con mi usuario y contraseña, hasta hoy que leyendo he visto que para instalarlo correctamente habia que eliminar el visor de sucesos.
Lo he instalado, igual que la otra vez, salve las tablas por lo que las he vuelto a importar tal cual las tenia, y estoy viendo que no me deja conectarme, el servidor esta en mi local, en mi propio ordenador, asi se lo hago indicar a la hora de conectarme apuntando al puerto :1521.
Incluso he leido que no podia estar accediendo y he hecho un telnet localhost:1521 para verificar que si accede, podria acceder a mi BBDD, pero no puedo hacer telnet.
Adjunto error log que me sale en pantalla:
Cita:
Y ya no se que puede ser, a alguien se le ocurre alguna solucion? ADVERTENCIA: com.mchange.v2.resourcepool.BasicResourcePool$Acqu ireTask@e3010 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception:
java.sql.SQLException: The Network Adapter could not establish the connection
at oracle.jdbc.driver.SQLStateMapping.newSQLException (SQLStateMapping.java:70)
at oracle.jdbc.driver.DatabaseError.newSQLException(D atabaseError.java:131)
at oracle.jdbc.driver.DatabaseError.throwSqlException (DatabaseError.java:197)
at oracle.jdbc.driver.DatabaseError.throwSqlException (DatabaseError.java:525)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnecti on.java:413)
at oracle.jdbc.driver.PhysicalConnection.<init>(Physi calConnection.java:508)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnect ion.java:203)
at oracle.jdbc.driver.T4CDriverExtension.getConnectio n(T4CDriverExtension.java:33)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriv er.java:510)
at com.mchange.v2.c3p0.DriverManagerDataSource.getCon nection(DriverManagerDataSource.java:134)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSourc e.getPooledConnection(WrapperConnectionPoolDataSou rce.java:182)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSourc e.getPooledConnection(WrapperConnectionPoolDataSou rce.java:171)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$ 1PooledConnectionResourcePoolManager.acquireResour ce(C3P0PooledConnectionPool.java:137)
at com.mchange.v2.resourcepool.BasicResourcePool.doAc quire(BasicResourcePool.java:1014)
at com.mchange.v2.resourcepool.BasicResourcePool.acce ss$800(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$Acqu ireTask.run(BasicResourcePool.java:1810)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$ PoolThread.run(ThreadPoolAsynchronousRunner.java:5 47)
Caused by: oracle.net.ns.NetException: The Network Adapter could not establish the connection
at oracle.net.nt.ConnStrategy.execute(ConnStrategy.ja va:328)
at oracle.net.resolver.AddrResolution.resolveAndExecu te(AddrResolution.java:421)
at oracle.net.ns.NSProtocol.establishConnection(NSPro tocol.java:630)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:2 06)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnec tion.java:966)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnecti on.java:292)
... 12 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl .java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSoc ketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.j ava:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.j ava:366)
at java.net.Socket.connect(Socket.java:525)
at java.net.Socket.connect(Socket.java:475)
at java.net.Socket.<init>(Socket.java:372)
at java.net.Socket.<init>(Socket.java:186)
at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.ja va:127)
at oracle.net.nt.ConnOption.connect(ConnOption.java:1 26)
at oracle.net.nt.ConnStrategy.execute(ConnStrategy.ja va:306)
... 17 more
java.sql.SQLException: The Network Adapter could not establish the connection
at oracle.jdbc.driver.SQLStateMapping.newSQLException (SQLStateMapping.java:70)
at oracle.jdbc.driver.DatabaseError.newSQLException(D atabaseError.java:131)
at oracle.jdbc.driver.DatabaseError.throwSqlException (DatabaseError.java:197)
at oracle.jdbc.driver.DatabaseError.throwSqlException (DatabaseError.java:525)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnecti on.java:413)
at oracle.jdbc.driver.PhysicalConnection.<init>(Physi calConnection.java:508)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnect ion.java:203)
at oracle.jdbc.driver.T4CDriverExtension.getConnectio n(T4CDriverExtension.java:33)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriv er.java:510)
at com.mchange.v2.c3p0.DriverManagerDataSource.getCon nection(DriverManagerDataSource.java:134)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSourc e.getPooledConnection(WrapperConnectionPoolDataSou rce.java:182)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSourc e.getPooledConnection(WrapperConnectionPoolDataSou rce.java:171)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$ 1PooledConnectionResourcePoolManager.acquireResour ce(C3P0PooledConnectionPool.java:137)
at com.mchange.v2.resourcepool.BasicResourcePool.doAc quire(BasicResourcePool.java:1014)
at com.mchange.v2.resourcepool.BasicResourcePool.acce ss$800(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$Acqu ireTask.run(BasicResourcePool.java:1810)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$ PoolThread.run(ThreadPoolAsynchronousRunner.java:5 47)
Caused by: oracle.net.ns.NetException: The Network Adapter could not establish the connection
at oracle.net.nt.ConnStrategy.execute(ConnStrategy.ja va:328)
at oracle.net.resolver.AddrResolution.resolveAndExecu te(AddrResolution.java:421)
at oracle.net.ns.NSProtocol.establishConnection(NSPro tocol.java:630)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:2 06)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnec tion.java:966)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnecti on.java:292)
... 12 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl .java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSoc ketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.j ava:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.j ava:366)
at java.net.Socket.connect(Socket.java:525)
at java.net.Socket.connect(Socket.java:475)
at java.net.Socket.<init>(Socket.java:372)
at java.net.Socket.<init>(Socket.java:186)
at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.ja va:127)
at oracle.net.nt.ConnOption.connect(ConnOption.java:1 26)
at oracle.net.nt.ConnStrategy.execute(ConnStrategy.ja va:306)
... 17 more