Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Servlet for Connection Pooling in NetBeans & builtin Tomcat

Reply
Thread Tools

Servlet for Connection Pooling in NetBeans & builtin Tomcat

 
 
Asad
Guest
Posts: n/a
 
      12-24-2004
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-net...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/tom...les-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-net...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!
 
Reply With Quote
 
 
 
 
jmens jmens is offline
Junior Member
Join Date: Oct 2006
Posts: 1
 
      10-19-2006
If it helps I have recently put together a how-to on getting netbeans 5 to use a connection pool to postgresql databases. you can view it at

http://www.mitarisk.com/blog/


It should work for any database backend as far as I can tell.

Hope it helps someone
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
subtle error slows code by 10x (builtin sum()) - replace builtin sumwithout using import? bdb112 Python 2 07-02-2011 03:13 AM
Tomcat and TCP connection pooling bigbinc Java 0 07-23-2004 12:17 PM
Tomcat Connection pooling with oracle Chandrakanth Java 0 06-07-2004 01:37 PM
Servlet question(Tomcat, web.xml, servlet-class, servlet-name) circuit_breaker Java 2 04-04-2004 03:26 AM
Tomcat and JDBC connection pooling Baba Java 3 02-23-2004 11:33 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57