1 Reply Latest reply on Jun 1, 2018 7:55 AM by Pierre Yotti

    Oracle DB connection from eclipse web application in jsp using apache server.xml file




      I am a newbie in java and trying to figure out a oracle data base connection from eclipse ide and tomcat server. Placed the code in server.xml like below.

      <Resource name="jdbc/SalesDB" global="jdbc/SalesDB" auth="Container" type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver" url ="jdbc:oracle:thin:@localhost:1521:xe" username="sales" password="sales123"  maxActive="100" maxIdle="20" minIdle="5" maxWait="10000"/>

      THen placed the details in

      context.xml like below

       <ResourceLink name="jdbc/MyLocalDB" global="jdbc/SalesDB" auth="Container" type="javax.sql.DataSource" />

      Now i would like to find the path which can be used in jsp page. enter image description here

      ds=(DataSource) ctx.lookup("java:/jdbc/MyLocalDB");