Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Paging records and jsp  RSS feed

 
Latif Laboussa
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to show all records retrieved from an Oracle DB in a jsp page. I would like to have a complete and simple example (with codes) using beans, taglibraries or some thing else which should works easily....
Kind Regards
Latif
 
Shawn Bayern
Author
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can simply use JSTL's <sql:query> tag. To do this with Oracle, you'd set up the connection using <sql:setDataSource> (or in your application's deployment descriptor) and then use <sql:query> to retrieve the information. As a complete example, here's something that works against a local Oracle database:

To use this, simply download a JSTL implementation -- such as the one at http://jakarta.apache.org/builds/jakarta-taglibs/releases/standard/, then install it into your applications WEB-INF/lib directory, which should also contain Oracle's classes12.jar file (you may have classes12.zip, which you should rename to classes12.jar).
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
another option is the pager taglib
http://jsptags.com/tags/navigation/pager/pager-taglib-1.1.html
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!