Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC conncetion through context.xml SID

 
S Guru
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

In our application we are creating connection pool using context.xml. Everything works good if I give SID . If I change SID to service name..application raises exception. IS there any alternative to use Service name instead of SID in url?

Context.xml,

<Resource name="jdbc/Oracle-dev"
auth="Container"
type="javax.sql.DataSource"
factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
username="abc"
password="abc"
driverClassName="oracle.jdbc.driver.OracleDriver"
url="jdbc: oracle:thin:@10.112.200.29:1521:STT41"
maxWait="2000"
removeAbandoned="true"
maxActive="20"
maxIdle="10"
initialSize="5"
testOnBorrow="true"
validationQuery="select 1 from dual"
removeAbandonedTimeout="60"
logAbandoned="true"/>


Exception , when I change SID(STT41) to servicename(devstt),

SQLException when creating connection. error msg:Cannot create PoolableConnectionFactory (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:
10.112.200.29:1521:devstt), error info:Cannot create PoolableConnectionFactory (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:
10.112.200.29:1521:devstt
)
 
Fatih Keles
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you try this syntax? And what is wrong with SID?
 
S Guru
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply. Actually I resolved the issue earlier by giving the service name as host:port/servicename in the URL. It started working good. Anyway thanks for the link. In our side we are advised to use servicename instead of sid. Our production support team are planning not to support sid for some reason.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic