I am going from a html-->servlet-->output to a jsp-->javabean-->jsp
configuration.
In my servlet I connect via JNDI like this:
public void init(ServletConfig config) throws ServletException{
super.init(config);
try{
Context env = (Context) new
InitialContext().lookup("java:comp/env");
pool = (DataSource) env.lookup("jdbc/app1");
if (pool == null)
throw new ServletException("`jdbc/app1' is an unknown
DataSource");
}catch (NamingException e) {
throw new ServletException(e);
}
How would I connect using a JSP? Or would this be done in the javabean?
TIA
Tom K.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.557 / Virus Database: 349 - Release Date: 12/30/2003