File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Problem with retrieving data from Java Bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Problem with retrieving data from Java Bean" Watch "Problem with retrieving data from Java Bean" New topic
Author

Problem with retrieving data from Java Bean

Yasuo Kawa
Greenhorn

Joined: Aug 23, 2001
Posts: 1
Hi
I tried to display the result of database(MS access) on JSP using Java bean.
My javabean has connected to the database using jdbc odbc bridge and the result of the SQL statement stated in the Java bean is supposed to be passed on to JSP to display. However, I got the following error. Please give me any idea to fix this problem. The jsp file seemd not be able to find data from the JavaBean.
I would appreciate any help!!
Error: 500 Location: /my_bookmarks.jspInternal Servlet Error:javax.servlet.ServletException: No data found
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:459)
at _0002fmy_0005fbookmarks_0002ejspmy_0005fbookmarks_jsp_1._jspService(_0002fmy_0005fbookmarks_0002ejspmy_0005fbookmarks_jsp_1.java:133)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)
Root cause: java.sql.SQLException: No data found
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6212)
at sun.jdbc.odbc.JdbcOdbc.SQLGetDataString(JdbcOdbc.java:3266)
at sun.jdbc.odbc.JdbcOdbcResultSet.getDataString(JdbcOdbcResultSet.java:5377)
at sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:320)
at sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:376)
at _0002fmy_0005fbookmarks_0002ejspmy_0005fbookmarks_jsp_1._jspService(_0002fmy_0005fbookmarks_0002ejspmy_0005fbookmarks_jsp_1.java:100)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
Since the root cause is:
Root cause: java.sql.SQLException: No data found
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6212)
the problem is not between the JSP and the bean but between the bean and your SQL database.
You need to debug the bean away from the JSP environment - write a simple utility to test it.
Bill
------------------
author of:
Hideaki Takashima
Greenhorn

Joined: Jul 25, 2001
Posts: 13
Hi.Bill Thank you for your reply.
I tested the connection to the database with the simple utility.
It worked. It means that the connection to the database was not problem. But, when I tried to display the result of the database on the jsp file using the Java Bean, the same error still came out. I am using Tomcat 3.2.1 and window 2000 pro. if you give me any advice or clue, I would appreciate.
Thank you
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with retrieving data from Java Bean