This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Im testing datasource in tomcat using oracle(database).i configure the server.xml as well as the web.xml,but when i try to run my jsp page im getting an error message "the network adapter cannot make connection.....".But when i try to hard code it, the normal way of connecting to the database(Class.forname(),DriverManager.getConnection) it works fine. here's my configuration of the server.xml and web.xml. first, i added these code in the server.xml <Context path="/DBTest" docBase="DBTest" debug="5" reloadable="true" crossContext="true"> <Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_DBTest_log." suffix=".txt" timestamp="true"/>
Hi, Your web.xml is right but I am not sure of server.xml, we use Oracle 9iAS, so we configure in data-sources.xml Anyway try following in your code InitialContext ctx=new InitialContext(); DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/mmrrcdb");