Hi thank you for reading my post. I defined a data-source in tomcat administration console. now i want to use this data source inside my servlet how i can do that ? I know some basic like defining the following objects , but i do not know how to initiate initialContext. which properties we should pass the initialContext constructor ?
Hi Thank you for reply. what i have done so far is : I defined the datasource inside the admin console of tomcat as a global data source. I foolowed the tutorial and i still get error : javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
the code that i used it :
i even changed java:comp/env/jdbc/be_Publisher to java:comp/env/jdbc/be_Publisher but it still return the same problem.
the datasource looks like the following in the server.xml
I should explain that , if i add the datasource to my application context each time that i deploy it into tomcat the application works ok , but as soon as i redeploy it it will loss that datasource configuration.
I tried to add a reference to that datasource in my own web.xml something like :