Yay LOL -----Original Message----- From: Riaan Oberholzer [mailto:[EMAIL PROTECTED] Sent: 20 June 2003 14:34 To: Tag Libraries Users List Subject: Re: JSTL:sql - Datasource via jndi lookup? SOLVED
*phew*.... finally.... When using WebLogic, the weblogic.xml must of course also be set up for the resource.... done that and it is working fine. Thanks for everyone who helped. --- Michael Duffy <[EMAIL PROTECTED]> wrote: > > Hi Riaan, > > Did you try putting your error message into a Google > search? I did - here's one link that it turned up: > > http://java.sun.com/products/jdbc/faq.html#9 > > Check your database URL for starters. > > Does the WAR that I sent you deploy and run under > WebLogic if you change to your data source? > > There was a guy on this thread the other day who had > to set up a data source with WebLogic. Did you see > his posts? He used the WebLogic console to set up > his > data source, I believe. He was successful with it. > You should check out the archive to see what he did. > - > MOD > > --- Riaan Oberholzer <[EMAIL PROTECTED]> > wrote: > > The Driver classes are there. As I said, the > > Datasource works fine for the other parts of the application. > > > > Further to note, I am using BEA WebLogic (not > > Tomcat) > > and Oracle. (This is a different application than > > the > > one I mentioned yesterday) > > > > About the global datasource - that's the way the > > company does things (I have no say in that). > > > > > > > > --- Michael Duffy <[EMAIL PROTECTED]> wrote: > > > > > > Hi Riaan, > > > > > > I'd suggest going through what I sent you again, > > > because the setup that I use works under Tomcat. > > > > I've > > > done it that way for several different apps now, > > and > > > they all work fine. I wouldn't deviate from it > at > > > all > > > until you know you can make this work once. > After > > > that, you can improvise all you like knowing > that > > > you've got a baseline to go back to. > > > > > > You CAN make your data source global. > Personally, > > > my > > > preference is to keep it local to my app. > > > > > > "No suitable driver" bring JDBC driver class > name > > or > > > CLASSPATH issues to mind. You said you put your > > > MySQL > > > JDBC JAR in TOMCAT_HOME/common/lib. If that's > > true, > > > Tomcat must be able to find it. I'd make sure > > that > > > the driver class name is spelled properly and > that > > > it's in the right path in the MySQL JAR. I'd > make > > > sure that I had the right JDBC driver version, > > too. > > > Make sure it matches your MySQL version > precisely. > > > > > > What about other Commons JARs, like > > commons-dbcp.jar > > > and commons-pool.jar? Are those in TOMCAT_HOME/common/lib, too? > > > In the context.xml <ResourceParams>, you tell Tomcat to use > > > org.apache.commons.dbcp.BasicDataSourceFactory > as > > > the > > > data source factory class. That's in the > > > commons-dbcp.jar. If you don't have that in > > > TOMCAT_HOME/common/lib, it won't work. You get > > the > > > Commons JARs from Jakarta, too. > > > > > > Good luck. - MOD > > > > > > --- Riaan Oberholzer <[EMAIL PROTECTED]> > > > wrote: > > > > I have done exactly what you describe below, > > > except > > > > not creating the resource reference - the > > > > "jdbc/your-data-source-name" value points to a > > > JNDI > > > > lookup supplied by the administrator, which is > a > > > > datasource global to all apps, not just my > > > context. > > > > (That should work, right?) > > > > > > > > The Datasource works - other parts of my > > > application > > > > can use it fine, but JSTL throws this > exception > > > when > > > > I > > > > try to use it: > > > > > > > > javax.servlet.jsp.JspException: Unable to get connection, > > > > DataSource invalid: "No suitable > > > driver" > > > > > > > > Any ideas? > > > > > > > > > > > > > > > > --- Michael Duffy <[EMAIL PROTECTED]> wrote: > > > > > > > > > > Hi Riaan, > > > > > > > > > > It's even better than that. > > > > > > > > > > Create a context.xml file and add a > <Resource> > > > > that > > > > > describes your data source. > > > > > > > > > > In your web.xml, add these tags: > > > > > > > > > > <context-param> > > > > > <param-name> > > > > > javax.servlet.jsp.jstl.sql.dataSource > > > > > </param-name> > > > > > > > > > > > > > > > <param-value>jdbc/your-data-source-name</param-value> > > > > > </context-param> > > > > > > > > > > <resource-ref> > > > > > <description>Your Data Source</description> > > > > > > > > > > > > > > > <res-ref-name>jdbc/your-data-source-name</res-ref-name> > > > > > <res-type>javax.sql.DataSource</res-type> > > > > > <res-auth>Container</res-auth> > > > > > </resource-ref> > > > > > > > > > > This data source is now the default for this > > > > > context. > > > > > Your JSTL SQL tags will simply pick it up > and > > > use > > > > > it, > > > > > without having to put a <sql:setDataSource> > > tag > > > in > > > > > any > > > > > page. > > > > > > > > > > You can declaratively change your data > source > > by > > > > > modifying the context.xml, leaving your > pages > > > free > > > > > to > > > > > simply display. > > > > > > > > > > Thanks to Shawn Bayern for pointing this one > > out > > > > to > > > > > me. - MOD > > > > > > > > > > --- Riaan Oberholzer > > <[EMAIL PROTECTED]> > > > > > wrote: > > > > > > Thanks, I downloaded the distribution and > > the > > > > JSTL > > > > > > specs. It seems my required functionality > is > > > > > there, > > > > > > but for one thing: > > > > > > > > > > > > In the JSLT specifiction, when setting up > a > > > > > > datasource > === message truncated === __________________________________ 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]
