Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

Database Pooling Follow-up

Scott Purcell

2005-08-31

Replies:

Hello,


I want to say thanks for the links yesterday in regards to my pooling problem. After reading the docs, I have a better handle on how this will work.
I am ready to test, and I was able to get the following to work within a JSP page.

But I would really like to create a Singleton class that could hand out connections based upon something like: singleton.getHandle("jndiname"); So in my business object I can hand in a "name" and let the busines object get the connection, etc.

Does that make sense. Only problem is, I cannot figure out how to transfer the JSP snippet below, to physical java code.

Anyone know?

Thanks,
Scott



####### JSP that works correctly ... would like to do this in a class #######



<%@(protected)" %>
<%@(protected)" %>

<sql:query var="rs" dataSource="jdbc/TestDB">
select id, foo, bar from testdata
</sql:query>

<html>
<head>
  <title>DB Test</title>
</head>
<body>

<h2>Results</h2>

<c:forEach var="row" items="${rs.rows}">
  Foo ${row.foo}<br/>
  Bar ${row.bar}<br/>
</c:forEach>

</body>
</html>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.