I am using DBTags in an app I'm working on... very simple, just one jsp page.  I am 
confused about how to use a datasource to get the connection. In the API it says 

"The connection tag also accepts a reference to a Servlet attribute containing a 
javax.sql.DataSource object. (The attribute is found via the findAttribute() method of 
PageContext.):"

I have used scriptlets to create a DataSource object from a JNDI named connection pool:
      
      <% Hashtable params = new Hashtable(); %>
      <% params.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, 
"com.ibm.ejs.ns.jndi.CNInitialContextFactory"); %>
      <% Context ctx = new javax.naming.InitialContext(params); %>
      <% javax.sql.DataSource ds = (javax.sql.DataSource) 
ctx.lookup("jdbc/mydatabase"); %>

How do I now use this DataSource in my connection tag?
Thanks.

 
-- 
Karen Lee
Open Systems Group
Northeast Regional Data Center
University of Florida
[EMAIL PROTECTED]

Reply via email to