jstl sql dataSource configuration help

2002-04-01 Thread James Hazel

Hi.

I am a student taking a class in JSP's and my current project is to use the
jstl in a web-app tied into a database.  I believe the problem I am having
derives from getting a datasource.

my jsp code is:
sql:query var=stuff dataSource=${dataSource}
SELECT * FROM articles/sql:query

c:out value=Query completed.  Rows returned are:  /
c:out value=$stuff.getSize() /

I configured the dataSource as a class implementing the javax.sql.DataSource
interface and use it in other places to create the database, but the above
query always returns as if the 'stuff' variable is not initialized: Query
completed.  Rows returned are:$stuff.getSize()

I create the dataSource during filter initialization and bind it to the
context using the name dataSource.  I have been to the tutorial and read
through all the documentation, but apparently missed the answer.

Any help or advice - including where to look - would be greatly appreciated.

TIA,

Jim.


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: jstl sql dataSource configuration help

2002-04-01 Thread Shawn Bayern

On Mon, 1 Apr 2002, James Hazel wrote:

 my jsp code is:
 sql:query var=stuff dataSource=${dataSource}
 SELECT * FROM articles/sql:query
 
 c:out value=Query completed.  Rows returned are:  /
 c:out value=$stuff.getSize() /
 
 I configured the dataSource as a class implementing the javax.sql.DataSource
 interface and use it in other places to create the database, but the above
 query always returns as if the 'stuff' variable is not initialized: Query
 completed.  Rows returned are:$stuff.getSize()

I think you're just using the expression incorrectly.  You want to write

  c:out value=${stuff.size} /

instead.

-- 
Shawn Bayern
Author, JSP Standard Tag Library  http://www.jstlbook.com
(coming this summer from Manning Publications)


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




[OFF-TOPIC] Re: jstl sql dataSource configuration help

2002-04-01 Thread Dave Newton

On Monday 01 April 2002 04:45 pm, James Hazel wrote:
 I am a student taking a class in JSP's and my current project is to use the
 jstl in a web-app tied into a database.  I believe the problem I am having
 derives from getting a datasource.

When I was a kid I took Fortran (and Prime assembly!) and our database was a 
text file and we got our email over a uucp connection.

Hrmmm. Wow.

 sql:query var=stuff dataSource=${dataSource}
  SELECT * FROM articles/sql:query
 c:out value=Query completed.  Rows returned are:  /
 c:out value=$stuff.getSize() /

I would have sworn that my code was longer than this, too.

I am occasionally amazed (and somewhat disturbed ;) at all that has happened 
since them thar days of old. Now I'm mostly struggling to keep up with all 
the new APIs, unit testing frameworks, and eXtreme programming tools and 
slowly deciding that I should just paint pictures or play guitar or something.

Oh, everybody kindly send Intel an email reminding them that it's bad karma 
to take Yoga Inside (they teach yoga to incarcerated juvenile delinquents) to 
court claiming trademark dilution.

Dave Feeling slightly melancholy Newton

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]