-
1. Re: JSTL sql:setDataSource and JCA
alchemista Jun 1, 2006 8:38 AM (in response to cascadia4u)I have the same problem with Tomcat and Oracle driver.
I have my oracle-ds.xml in the deploy directory and it deploys fine in my application. I'm trying to write a quick test JSP using the JSTL SQL tag. I've tried setDataSource as well as specifying the datasource directly in the sql:query attribute.
Both of them give No Suitable Driver.
I put the driver in deploy/lib (where it was), and I also tried putting it in WEB-INF/lib but that failed as well. -
2. Re: JSTL sql:setDataSource and JCA
vsacheti Jul 9, 2007 6:45 PM (in response to cascadia4u)Can anybody who has resolved this problem reply to this?
Thanks -
3. Re: JSTL sql:setDataSource and JCA
cascadia4u Jul 9, 2007 7:33 PM (in response to cascadia4u)I finally figured out that JBoss does not conform to the J2EE standard for storing the DataSource references in their JNDI repository. I don't remember at the moment what the standard is (something like java.env:DataSourceName), but it is not referenceable as java:DataSourceName.
So, I registered it within the ServletContext as a variable during startup in the ContextListener:
dataSource = (DataSource) initialContext.lookup("java:asa");
servletContext.setAttribute("asa", dataSource);
Then I was able to reference it in the JSP as:
<sql:setDataSource dataSource="${asa}" />
That seemed to do the trick.
I hope that helps!