This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan 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");