Skip to Main Content

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

Sunny86Mar 10 2018 — edited Jun 1 2018

Hello

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");

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked due to inactivity on Jun 29 2018
Added on Mar 10 2018
1 comment
958 views