Getting default data source into JSP

2003-07-28 Thread Michael Duffy

I'd like to write a simple JSP that would display all
the JDBC meta-data for the default data source.  

I'm thick - how do I refer to it in the JSP?  Shawn
Bayern's JSTL In Action says that the constant is
Config.SQL_DATA_SOURCE, and its variable name is
javax.servlet.jsp.jstl.sql.dataSource.  What scope is
this variable in, and how can I get at it in my JSP?

It sounds like I'll have to use the rt library, since
I'd like to have JSP code that will look like this:

c_rt:out value=%=
dataSource.getConnection().getMetaData().getDriverMajorVersion()
%/

Any advice would be appreciated.  Thanks - MOD

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



Re: Getting default data source into JSP

2003-07-28 Thread Shawn Bayern
On Mon, 28 Jul 2003, Michael Duffy wrote:

 I'm thick - how do I refer to it in the JSP?  Shawn Bayern's JSTL In
 Action says that the constant is Config.SQL_DATA_SOURCE, and its
 variable name is javax.servlet.jsp.jstl.sql.dataSource.  What scope is
 this variable in, and how can I get at it in my JSP?

 It sounds like I'll have to use the rt library [...]

There is indeed a standard constant and a standard name for the
context-initialization parameter, but the data is not necessarily saved in
a particular scope with a particular name.  (If I remember correctly, this
was designed to give greater flexibility to implementations and future
versions of JSTL.)

To retrieve the data, you'll want to use the Config class itself, which
abstracts the variables for programmers.  I can't think of any way to
retrieve the information in a standard fashion using just the 'el' tags.

-- 
Shawn Bayern
JSTL in Action   http://www.jstlbook.com


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