1

I have meet one issue:

There is one database,it could be connected by sqldeveloper tools

enter image description here

But I want to use c3p0 to connect the database with the jdbcurl:

jdbc:oracle:thin:@2.2.6.11:2709:hl.webtest.com

get these error: WARN - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@55854763 -- 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 (5). Last acquisition attempt exception: 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.SQLStateMapping.newSQLException(SQLStateMapping.java:70)

why C3p0 throw the error? It seemed that the jdbcurl is wrong, what is correct jdbcurl with the Service Name?

nick wu
  • 139
  • 1
  • 5
  • 17

1 Answers1

3
jdbc:oracle:thin:@//2.2.6.11:2709/hl.webtest.com

it is use service_name, not the SID
You need the // and the /

Santhan Salai
  • 3,888
  • 19
  • 29
Shawn Shi
  • 48
  • 4