• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

JDBC conncetion through context.xml SID

 
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
)
 
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.
 
She'll be back. I'm just gonna wait here. With this tiny ad:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!