You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Riaan Oberholzer <ri...@yahoo.com> on 2003/06/19 14:04:15 UTC

JSTL:sql - Datasource via jndi lookup?

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 <ma...@markstarmer.co.uk>
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:riaanoberholzer@yahoo.com] 
> Sent: 19 June 2003 11:37
> To: taglibs-user@jakarta.apache.org
> 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: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


RE: JSTL:sql - Datasource via jndi lookup? SOLVED

Posted by Mark B Starmer <ma...@markstarmer.co.uk>.
Yay LOL

-----Original Message-----
From: Riaan Oberholzer [mailto:riaanoberholzer@yahoo.com] 
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 <du...@yahoo.com> 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 <ri...@yahoo.com>
> 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 <du...@yahoo.com> 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 <ri...@yahoo.com>
> > > 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 <du...@yahoo.com> 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
> > <ri...@yahoo.com>
> > > > > 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: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: JSTL:sql - Datasource via jndi lookup? SOLVED

Posted by Riaan Oberholzer <ri...@yahoo.com>.
*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 <du...@yahoo.com> 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 <ri...@yahoo.com>
> 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 <du...@yahoo.com> 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 <ri...@yahoo.com>
> > > 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 <du...@yahoo.com> 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
> > <ri...@yahoo.com>
> > > > > 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: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: JSTL:sql - Datasource via jndi lookup?

Posted by Riaan Oberholzer <ri...@yahoo.com>.
Maybe this helps stating what is wrong:

Instead of setting up a default datasource in the
web.xml as I mentioned earlier, I now use the
"<sql:setDataSource />" tag with EXACTLY the same
settings that the (already deployed and working)
Datasource is using. 

THIS WORKS.

It is clear that the datasource is fine and the
settings used also. It must then be something with how
JSTL is trying to lookup the datasource with JNDI....



--- Michael Duffy <du...@yahoo.com> 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 <ri...@yahoo.com>
> 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 <du...@yahoo.com> 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 <ri...@yahoo.com>
> > > 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 <du...@yahoo.com> 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
> > <ri...@yahoo.com>
> > > > > 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: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: JSTL:sql - Datasource via jndi lookup?

Posted by Riaan Oberholzer <ri...@yahoo.com>.
The datasource works. Even other parts of THE SAME
application can access it, using standard JNDI
lookups. Just somehow it goes bad when using it in
JSTL.

Maybe for some reason it is searched for in the
application's context and not globally, or could that
not be?

I set the datasource up using the weblogic/ant
commands. Really nice and easy. The application has
been running for a few months, just now I am trying to
convert some of it to JSTL... I haven't meddled with
the datasource settings or anything, onlye the JSP's
and bringing in the required tld and jar files.





--- Michael Duffy <du...@yahoo.com> 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 <ri...@yahoo.com>
> 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 <du...@yahoo.com> 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 <ri...@yahoo.com>
> > > 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 <du...@yahoo.com> 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
> > <ri...@yahoo.com>
> > > > > 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: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: JSTL:sql - Datasource via jndi lookup?

Posted by Michael Duffy <du...@yahoo.com>.
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 <ri...@yahoo.com>
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 <du...@yahoo.com> 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 <ri...@yahoo.com>
> > 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 <du...@yahoo.com> 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
> <ri...@yahoo.com>
> > > > 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
> > > <ma...@markstarmer.co.uk>
> > > > > 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:riaanoberholzer@yahoo.com] 
> > > > > > Sent: 19 June 2003 11:37
> > > > > > To: taglibs-user@jakarta.apache.org
> > > > > > 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
> > 
> === message truncated ===
> 
> 
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> taglibs-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: JSTL:sql - Datasource via jndi lookup?

Posted by Riaan Oberholzer <ri...@yahoo.com>.
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 <du...@yahoo.com> 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 <ri...@yahoo.com>
> 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 <du...@yahoo.com> 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 <ri...@yahoo.com>
> > > 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
> > <ma...@markstarmer.co.uk>
> > > > 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:riaanoberholzer@yahoo.com] 
> > > > > Sent: 19 June 2003 11:37
> > > > > To: taglibs-user@jakarta.apache.org
> > > > > 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
> 
=== message truncated ===


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: JSTL:sql - Datasource via jndi lookup?

Posted by Michael Duffy <du...@yahoo.com>.
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 <ri...@yahoo.com>
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 <du...@yahoo.com> 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 <ri...@yahoo.com>
> > 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
> <ma...@markstarmer.co.uk>
> > > 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:riaanoberholzer@yahoo.com] 
> > > > Sent: 19 June 2003 11:37
> > > > To: taglibs-user@jakarta.apache.org
> > > > 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:
> > > taglibs-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> > > taglibs-user-help@jakarta.apache.org
> > > 
> > 
> > 
> > __________________________________
> > Do you Yahoo!?
> > SBC Yahoo! DSL - Now only $29.95 per month!
> > http://sbc.yahoo.com
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > taglibs-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > taglibs-user-help@jakarta.apache.org
> > 
> 
> 
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> taglibs-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


RE: JSTL:sql - Datasource via jndi lookup?

Posted by Riaan Oberholzer <ri...@yahoo.com>.
I said previously I am using Oracle... sorry, I'm
using sybase (that's what happens when you work on
multiple projects in different enviroments!)

Driver classes are sybase-jconnect-5.2. That's pretty
much fixed, no alternatives there (it already in
production with x number of applications).


--- Mark B Starmer <ma...@markstarmer.co.uk>
wrote:
> You need to add a database driver to the libs dir of
> tomcat, what dbms
> are you using?
> 
> -----Original Message-----
> From: Riaan Oberholzer
> [mailto:riaanoberholzer@yahoo.com] 
> Sent: 20 June 2003 11:40
> To: Tag Libraries Users List
> Subject: Re: JSTL:sql - Datasource via jndi lookup?
> 
> 
> 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 <du...@yahoo.com> 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 <ri...@yahoo.com>
> > 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
> <ma...@markstarmer.co.uk>
> > > 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:riaanoberholzer@yahoo.com]
> > > > Sent: 19 June 2003 11:37
> > > > To: taglibs-user@jakarta.apache.org
> > > > 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:
> > > taglibs-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> > > taglibs-user-help@jakarta.apache.org
> > > 
> > 
> > 
> > __________________________________
> > Do you Yahoo!?
> > SBC Yahoo! DSL - Now only $29.95 per month!
> > http://sbc.yahoo.com
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > taglibs-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > taglibs-user-help@jakarta.apache.org
> > 
> 
> 
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> taglibs-user-unsubscribe@jakarta.apache.org
> 
=== message truncated ===


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


RE: JSTL:sql - Datasource via jndi lookup?

Posted by Mark B Starmer <ma...@markstarmer.co.uk>.
You need to add a database driver to the libs dir of tomcat, what dbms
are you using?

-----Original Message-----
From: Riaan Oberholzer [mailto:riaanoberholzer@yahoo.com] 
Sent: 20 June 2003 11:40
To: Tag Libraries Users List
Subject: Re: JSTL:sql - Datasource via jndi lookup?


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 <du...@yahoo.com> 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 <ri...@yahoo.com>
> 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 <ma...@markstarmer.co.uk>
> > 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:riaanoberholzer@yahoo.com]
> > > Sent: 19 June 2003 11:37
> > > To: taglibs-user@jakarta.apache.org
> > > 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:
> > taglibs-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > taglibs-user-help@jakarta.apache.org
> > 
> 
> 
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> taglibs-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: JSTL:sql - Datasource via jndi lookup?

Posted by Riaan Oberholzer <ri...@yahoo.com>.
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 <du...@yahoo.com> 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 <ri...@yahoo.com>
> 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 <ma...@markstarmer.co.uk>
> > 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:riaanoberholzer@yahoo.com] 
> > > Sent: 19 June 2003 11:37
> > > To: taglibs-user@jakarta.apache.org
> > > 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:
> > taglibs-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > taglibs-user-help@jakarta.apache.org
> > 
> 
> 
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> taglibs-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: JSTL:sql - Datasource via jndi lookup?

Posted by Michael Duffy <du...@yahoo.com>.
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 <ri...@yahoo.com>
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 <ma...@markstarmer.co.uk>
> 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:riaanoberholzer@yahoo.com] 
> > Sent: 19 June 2003 11:37
> > To: taglibs-user@jakarta.apache.org
> > 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:
> taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> taglibs-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


RE: JSTL:sql - Datasource via jndi lookup?

Posted by Mark B Starmer <ma...@markstarmer.co.uk>.
The link below details how to setup JSTL with JNDI 

http://www.onjava.com/lpt/a/2610

Best Regards

Mark Starmer

http://www.markstarmer.co.uk

-----Original Message-----
From: Riaan Oberholzer [mailto:riaanoberholzer@yahoo.com] 
Sent: 19 June 2003 13:04
To: Tag Libraries Users List
Subject: JSTL:sql - Datasource via jndi lookup?


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 <ma...@markstarmer.co.uk>
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:riaanoberholzer@yahoo.com]
> Sent: 19 June 2003 11:37
> To: taglibs-user@jakarta.apache.org
> 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: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org