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
> > > there is no attribute for specifying a JNDI
> > lookup.
> > > It
> > > seems I must have the username, password, dburl
> > and
> > > driver at hand.
> > > 
> > > In my application, I am only giving a reference
> > > (JNDI
> > > lookup) to the datasource as setup by the admin
> in
> > > WebLogic. More detail is not known, so it seems
> I
> > > cannot setup a datasource with JSTL (the jakarta
> > > dbtags library DOES give this option)
> > > 
> > > Do I have an old JSTL spec, is there a way to
> get
> > a
> > > datasource via JNDI lookup or is that not
> > possible?
> > > 
> > > 
> > > --- Mark B Starmer
> <[EMAIL PROTECTED]>
> > > wrote:
> > > > I'm not sure what the db tags library does off
> > > hand,
> > > > but JSTL has SQL
> > > > tags which I'd presume performs most of the
> > > similar
> > > > functionality of the
> > > > db tags, forgive me if I'm wrong...
> > > > 
> > > > -----Original Message-----
> > > > From: Riaan Oberholzer
> > > > [mailto:[EMAIL PROTECTED] 
> > > > Sent: 19 June 2003 11:37
> > > > To: [EMAIL PROTECTED]
> > > > Subject: official dbtags release available?
> > > > 
> > > > 
> > > > Does anyone know if an official release (with
> > > > version
> > > > number) is available for the jakarta-dbtags
> > > library?
> > > > 
> > > > 
> > > > On the jakarta website you can only download a
> > > > "current" which proves, in the documentation,
> to
> > > be
> > > > 1.0-B1 (Beta), dated August 2001. The index
> > shows
> > > > dbtags to be 1.1, though, but no place else is
> > it
> > > > listed as such.
> > > > 
> > > > What happened to this specific library's
> > > development
> > > > since August 2001?
> > > > 
> > > > It has really made my work easier, but the
> place
> > > > where
> > > > I work at has a policy that you are not
> allowed
> > to
> > > > use
> > > > any packages tagged as Alpha, Beta of Release
> > > > Candidate, which officially means I cannot use
> > the
> > > > dbtags library (*sigh*).
> > > 
> > > 
> > > 
> > > __________________________________
> > > 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]
> > > 
> > 
> > 
> > __________________________________
> > 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]
> > 
> 
> 
> __________________________________
> 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]
> 


__________________________________
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]

Reply via email to