This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I have just started using oracle9iAS . I am able to access my datasource from a Java client with the following code: Properties env = new Properties(); env.put(Context.INITIAL_CONTEXT_FACTORY,"com.evermind.server.rmi.RMIInitialContextFactory"); env.put(Context.PROVIDER_URL,"ormi://localhost"); env.put(Context.SECURITY_PRINCIPAL,"admin"); env.put(Context.SECURITY_CREDENTIALS,"ignite"); InitialContext ic = new InitialContext(env); DataSource ds = (DataSource)ic.lookup("jdbc/OracleTestCoreDS"); System.out.println("Data source is : "+ds);
But the EJB-suggested way of looking up : "jva:comp/env/jdbc/OracleTestCoreDS" in my ic.lookup parameter is not working. I have added the following resource-ref tag to my application-client.xml: <resource-ref> <res-ref-name>jdbc/OracleTestCoreDS</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth></resource-ref>
Can anyone let me know where i am going wrong? If the first lookup is working the proper registration of the data source is complete right? Is Any other orion specific file modification is required.