Excellent! - MOD
--- "Narayan, Anand" <[EMAIL PROTECTED]> wrote: > Got the solution to this on Weblogic. > > Firstly > I configured the datasource in weblogic using the > weblogic console. > > In web.xml I added the following lines > <context-param> > > <param-name>javax.servlet.jsp.jstl.sql.dataSource</param-name> > <param-value>jdbc/edmDataSource</param-value> > </context-param> > > <resource-ref> > <description>The default data source for > JSTL.</description> > <res-ref-name>jdbc/edmDataSource</res-ref-name> > <res-type>javax.sql.DataSource</res-type> > <res-auth>Container</res-auth> > </resource-ref> > > > In weblogic.xml I added the following > <weblogic-web-app> > <description>WebLogic Descriptor</description> > <reference-descriptor> > <resource-description> > > <res-ref-name>jdbc/edmDataSource</res-ref-name> > <jndi-name>spsDataSource</jndi-name> > </resource-description> > </reference-descriptor> > </weblogic-web-app> > > > Then I could use hte datasource in the JSP's without > doing a > sql:setDataSource > and without setting the dataSource attribute in the > sql:query and sql:update > tags. > > Thanks > Anand > > -----Original Message----- > From: Michael Duffy [mailto:[EMAIL PROTECTED] > Sent: Thursday, June 19, 2003 2:19 PM > To: Tag Libraries Users List > Subject: Re: Data Source problem - JSTL > > > > Hi Anand, > > Where did you specify the JDBC driver class name, > database URL, username, and password? You've got to > tell the data source those things, too. I define > them > in the context.xml, using <ResourceParams> under a > <Resource> tag. > > I don't know about your WebLogic docs, but here's > the > JNDI DataSource HOW-TO for Tomcat: > > http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-how > to.html > > Maybe that will help. > > If you set the default data source using the name > javax.servlet.jsp.jstl.sql.dataSource, you don't > have > to use the <sql:setDataSource> tag in your JSPs. > The > default data source will be picked up. > > HTH - MOD > > --- "Narayan, Anand" <[EMAIL PROTECTED]> > wrote: > > I am trying to configure a JNDI data source within > a > > JSTL application. > > The app server is weblogic 7.0 > > I have added the following to the web.xml > > > > <context-param> > > > > > <param-name>javax.servlet.jsp.jstl.sql.dataSource</param-name> > > <param-value>spsDataSource</param-value> > > </context-param> > > > > In the JSp I am trying to use the sql tags as > > follows: > > > > <sql:setDataSource var="edmDataSource" > > dataSource="spsDataSource"/> > > > > <sql:query var="results" > > dataSource="${edmDataSource}" scope="session"> > > SELECT x.*,y.name FROM sps_carrier_vendor_station > x, > > sps_vendor y WHERE > > x.vendor=y.id ORDER BY x.carrier asc, x.station > asc > > </sql:query> > > > > This is giving me the sollowing error on the app > > serve. It works if I do > > not use a data source and configure the > > DB connection ( URl, driver, user password etc.) > > right there in the JSP. > > Any ideas?? Thanks. > > > > javax.servlet.jsp.JspException: Unable to get > > connection, DataSource > > invalid: "N > > o suitable driver" > > at > > > org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnect > > ion(QueryTagSupport.java:308) > > at > > > org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag > > (QueryTagSupport.java:192) > > at > > > org.apache.taglibs.standard.tag.el.sql.QueryTag.doStartTag(QueryTag.j > > ava:125) > > at > > > jsp_servlet._carrier_vendor_station.__list_results._jspService(__list > > _results.java:171) > > at > > > weblogic.servlet.jsp.JspBase.service(JspBase.java:27) > > at > > > weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run > > (ServletStubImpl.java:1058) > > at > > > weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm > > pl.java:401) > > at > > > weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm > > pl.java:445) > > at > > > weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm > > pl.java:306) > > at > > > weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispat > > cherImpl.java:542) > > at > > > weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispat > > cherImpl.java:368) > > at > > > weblogic.servlet.jsp.PageContextImpl.include(PageContextImpl.java:120 > > ) > > at > > > jsp_servlet._carrier_vendor_station.__list._jspService(__list.java:32 > > 4) > > at > > > weblogic.servlet.jsp.JspBase.service(JspBase.java:27) > > at > > > weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run > > (ServletStubImpl.java:1058) > > at > > > weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm > > pl.java:401) > > at > > > weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm > > pl.java:445) > > at > > > weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm > > pl.java:306) > > at > > > weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio > > n.run(WebAppServletContext.java:5412) > > at > > > weblogic.security.service.SecurityServiceManager.runAs(SecurityServic > > eManager.java:744) > > at > > > weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe > > rvletContext.java:3086) > > at > > > weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm > > pl.java:2544) > > at > > > weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153) > > at > > > weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134) > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > __________________________________ > Do you Yahoo!? > SBC Yahoo! DSL - Now only $29.95 per month! > http://sbc.yahoo.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
