File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Pool Manager with MySQL - JSP ... need help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "Pool Manager with MySQL - JSP ... need help" Watch "Pool Manager with MySQL - JSP ... need help" New topic
Author

Pool Manager with MySQL - JSP ... need help

Sophia Oscario
Greenhorn

Joined: May 14, 2001
Posts: 22
I try to use Pool Manager 2.0 to handle database connection to MySQL from JSP.
But it returns an execption :
Exception Report:
javax.servlet.ServletException: javax/sql/ConnectionEventListener
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:442)
at org.apache.jsp.JDBCtest_jsp._jspService(JDBCtest_jsp.java:123)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:200)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:453)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:254)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:194)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:255)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:225)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2252)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:446)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:875)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:952)
at java.lang.Thread.run(Thread.java:484)

Here's My code :
<html>
<head>
<title>JDBC - MySQL</title>
</head>
<%@ page language="java" import="java.sql.*,com.codestudio.util.*" %>
<body>

<% SQLManager myManager = SQLManager.getInstance(); Connection myConn = myManager.requestConnection(); Statement st = myConn.createStatement(); ResultSet rs = st.executeQuery("select * from employee"); if (rs != null) { while (rs.next()) { String eid = rs.getString("empid"); String name = rs.getString("lastname") + ", " + rs.getString("firstname"); String extention = rs.getString("extention"); %> <% } } st.close(); myManager.returnConnection(myConn); %>
ID Name Extention
<%=eid %> <%=name %> <%=extention %>


</body>
</html>
Please anybody can tell me what's wrong ...
Thanks

------------------
** Science belongs to the world **


** Science belongs to the world **
Robert Brunner
Ranch Hand

Joined: Jul 18, 2001
Posts: 49
Originally posted by Sophia Oscario:
I try to use Pool Manager 2.0 to handle database connection to MySQL from JSP.
But it returns an execption :
Exception Report:
javax.servlet.ServletException: javax/sql/ConnectionEventListener
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:442)
at org.apache.jsp.JDBCtest_jsp._jspService(JDBCtest_jsp.java:123)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:200)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:453)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:254)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:194)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:255)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:225)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2252)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:446)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:875)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:952)
at java.lang.Thread.run(Thread.java:484)

Here's My code :
<html>
<head>
<title>JDBC - MySQL</title>
</head>
<%@ page language="java" import="java.sql.*,com.codestudio.util.*" %>
<body>

<% SQLManager myManager = SQLManager.getInstance(); Connection myConn = myManager.requestConnection(); Statement st = myConn.createStatement(); ResultSet rs = st.executeQuery("select * from employee"); if (rs != null) { while (rs.next()) { String eid = rs.getString("empid"); String name = rs.getString("lastname") + ", " + rs.getString("firstname"); String extention = rs.getString("extention"); %> <% } } st.close(); myManager.returnConnection(myConn); %>
ID Name Extention
<%=eid %> <%=name %> <%=extention %>


</body>
</html>
Please anybody can tell me what's wrong ...
Thanks



I can't see you code. Try to resubmit just your code.
Sophia Oscario
Greenhorn

Joined: May 14, 2001
Posts: 22
Sorry,
here is my code :
'<html>
'<head>
'<title>JDBC - MySQL</title>
'</head>
'<%@ page language="java" 'import="java.sql.*,com.codestudio.util.*" %><br /> '<body>
'
' ' ' ' ' ' '<% SQLManager myManager = SQLManager.getInstance(); Connection myConn = myManager.requestConnection(); Statement st = myConn.createStatement(); ResultSet rs = st.executeQuery("select * from employee"); if (rs != null) { while (rs.next()) { String eid = rs.getString("empid"); String name = rs.getString("lastname") + ", " + rs.getString("firstname"); String extention = rs.getString("extention"); %> ' ' ' ' ' <% } } st.close(); myManager.returnConnection(myConn); %> '
IDNameExtention
<%=eid %> <%=name %><%=extention %>

'

'</body>
'</html>

------------------
** Science belongs to the world **
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Lets try this:

Hope this is clearer
Dave.
Jayanthimeena
Greenhorn

Joined: Jul 24, 2001
Posts: 17
The coding has to look similar to this
String manager = SQLManager.getInstance();
String conn = manager.requestConnection();
String stmt = conn.createStatement();
Resultset rs=null;
rs=stmt.excuteQuery("select * from employee");
if(rs.next())
string one=rs.getString(1);
.
.
.
similarly all
rs.close();
if you are using pool class then it has to be present in correct class path and in currently using "command" or "cmd" promt.
hope this might help you.

Sophia Oscario
Greenhorn

Joined: May 14, 2001
Posts: 22
Here is my code :

Is there something wrong in it ?

------------------
** Science belongs to the world **
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Pool Manager with MySQL - JSP ... need help