Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

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 on Jun 29 2018
Added on Mar 10 2018
1 comment
1,700 views