Win a copy of Secure Financial Transactions with Ansible, Terraform, and OpenSCAP this week in the Cloud/Virtualization forum!
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Configuration multiple resource DB.

 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need access thow or more distinct Data Base. How I can create two Resource name in server.xml in tomcat ?
I try insert this code, but it dont works.
<Context path="/PortalWeb" reloadable="true" docBase="C:\tomcat-4.1.24\jakarta-tomcat-4.1.24\webapps\PortalWeb" workDir="C:\tomcat-4.1.24\jakarta-tomcat-4.1.24\webapps\PortalWeb\work\org\apache\jsp" debug="5" crossContext="true">

<Resource name="jdbc/PortalWeb" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/PortalWeb"><parameter><name>factory</name><value>org.apache.commons.dbcp.BasicDataSourceFactory</value></parameter><parameter><name>username</name><value>userA</value></parameter><parameter><name>password</name><value>aaa</value></parameter><parameter><name>driverClassName</name><value>oracle.jdbc.driver.OracleDriver</value></parameter><parameter><name>url</name><value>jdbc racle:thin:@demo_gtw:1521:GCREDITO</value></parameter>
</ResourceParams>

<ResourceParams name="jdbc/SistemaSeguranca"><parameter><name>factory</name><value>org.apache.commons.dbcp.BasicDataSourceFactory</value></parameter><parameter><name>username</name><value>userB</value></parameter><parameter><name>password</name><value>bbb</value></parameter><parameter><name>driverClassName</name><value>oracle.jdbc.driver.OracleDriver</value></parameter><parameter><name>url</name><value>jdbc racle:thin:@demo_gtw:1521:GCREDITO</value></parameter>
</ResourceParams>

<ResourceParams name="jdbc/ConsultaRecargas"><parameter><name>factory</name><value>org.apache.commons.dbcp.BasicDataSourceFactory</value></parameter><parameter><name>username</name><value>userC</value></parameter><parameter><name>password</name><value>ccc</value></parameter><parameter><name>driverClassName</name><value>oracle.jdbc.driver.OracleDriver</value></parameter><parameter><name>url</name><value>jdbc racle:thin:@demo_gtw:1521:GISO8583</value></parameter>
</ResourceParams>

</Context>
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you've defined the resource-params but not the actual resource.
 
Oh the stink of it! Smell my tiny ad!
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic