I get a null error when trying to use pool with mySQL. Here is the source
and error. Database is active and all classes are loaded. When I run the
same script without pool, directly, it returs all the values in the table.
Also the table is populated completely and there are no NULL values or empty
anywhere. Any ideas? thank you.

Oleg.


<%@ page language="java" import="java.sql.*,com.codestudio.util.*" %>
<table border=1 width=400>
<tr>
<td><b>ID</b></td><td><b>Last Name</b></td>
<td><b>First Name</b></td><td><b>Extension</b></td></tr>

<%
SQLManager myMan = SQLManager.getInstance();
Connection myConn = myMan.requestConnection();

Statement stmt = myConn.createStatement();
java.sql.ResultSet myResultSet = stmt.executeQuery("select * from
employee");

if (myResultSet != null) {
while (myResultSet.next()) {
String eid = myResultSet.getString("empid");
String last = myResultSet.getString("lastname");
String first = myResultSet.getString("firstname");
String ext = myResultSet.getString("lastname");
 %>

 <tr>
 <td><%= eid %></td>
 <td><%= last %></td>
 <td><%= first %></td>
 <td><%= ext %></td>
 </tr>

<%
 }
}
stmt.close();
myMan.returnConnection(myConn);
%>


ERROR:

null
java.lang.NullPointerException
at jrun__dbqueryP2ejspd._jspService(jrun__dbqueryP2ejspd.java, Compiled
Code)
at allaire.jrun.jsp.HttpJSPServlet.service(HttpJSPServlet.java:40)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java, Compiled Code)
at
allaire.jrun.servlet.JRunNamedDispatcher.forward(JRunNamedDispatcher.java:34
)
at allaire.jrun.jsp.JSPServlet.service(JSPServlet.java:174)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java, Compiled Code)
at
allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.jav
a:88)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1131)
at allaire.jrun.servlet.JvmContext.dispatch(JvmContext.java:330)
at allaire.jrun.http.WebEndpoint.run(WebEndpoint.java:107)
at allaire.jrun.ThreadPool.run(ThreadPool.java, Compiled Code)
at allaire.jrun.WorkerThread.run(WorkerThread.java, Compiled Code)

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to