A
Asad
Hi,
I installed Netbeans 4.0 a few days ago and so far pretty impressed by
it. Previously I was using Tomat 4.0, and I like the idea of embedded
Tomcat 5 that can be managed via the IDE. To get things started, I
followed the article here:
http://www.netbeans.org/kb/using-netbeans/40/dbconn.html
to get a connection pool configured in the included Tomcat 5 web
server. Everything in the example works great. However, I don't want
to use the taglibs, and would rather write servlets and beans to do
the task. I tried following the example listed here:
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html
however that doesn't work for me (I get foo -1 or something; basically
its not working).
So I was wondering if someone could kindly provide me a simple servlet
that works in the Netbeans IDE so I can simply extend on the tutorial
here: http://www.netbeans.org/kb/using-netbeans/40/dbconn.html and and
draw connection from the tomcat 5 connection pool having configured
everything perfectly in this tutorial. Basically do the same thing as:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<sql:query var="queryresults" dataSource="jdbc/poolDB">
SELECT * FROM t_emp ORDER BY upper(f_name)
</sql:query>
<table border=1>
<tr>
<th>First</th><th>Last</th>
</tr>
<c:forEach var="row" items="${queryresults.rows}">
<tr>
<td><cut value="${row.f_name}" /></td>
<td><cut value="${row.l_name}" /></td>
</tr>
</c:forEach>
</table>
but in a servlet rather than using the tag library.
Very much appreciated!
I installed Netbeans 4.0 a few days ago and so far pretty impressed by
it. Previously I was using Tomat 4.0, and I like the idea of embedded
Tomcat 5 that can be managed via the IDE. To get things started, I
followed the article here:
http://www.netbeans.org/kb/using-netbeans/40/dbconn.html
to get a connection pool configured in the included Tomcat 5 web
server. Everything in the example works great. However, I don't want
to use the taglibs, and would rather write servlets and beans to do
the task. I tried following the example listed here:
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html
however that doesn't work for me (I get foo -1 or something; basically
its not working).
So I was wondering if someone could kindly provide me a simple servlet
that works in the Netbeans IDE so I can simply extend on the tutorial
here: http://www.netbeans.org/kb/using-netbeans/40/dbconn.html and and
draw connection from the tomcat 5 connection pool having configured
everything perfectly in this tutorial. Basically do the same thing as:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<sql:query var="queryresults" dataSource="jdbc/poolDB">
SELECT * FROM t_emp ORDER BY upper(f_name)
</sql:query>
<table border=1>
<tr>
<th>First</th><th>Last</th>
</tr>
<c:forEach var="row" items="${queryresults.rows}">
<tr>
<td><cut value="${row.f_name}" /></td>
<td><cut value="${row.l_name}" /></td>
</tr>
</c:forEach>
</table>
but in a servlet rather than using the tag library.
Very much appreciated!