Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 20th, 2006, 09:55 AM
Registered User
Join Date: Sep 2006
Location: yaba, lagos, Nigeria.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Please help my code is not giving me a result set

Please help my code is not giving me a result set for the search criteria ?
this is a bean i have written for the search criteria also attached is the code for the JSP page

 package diamx.admin; 
import java.io.*; 
import java.sql.*; 
import java.util.*; 

public class GuestData { 
   private Connection connection; 
   private Statement statement; 

   // construct TitlesBean object 
   public GuestData() throws Exception 
      // load the Cloudscape driver 

      // connect to the database 
     connection = DriverManager.getConnection( 

     statement = connection.createStatement(); 


  public List getGuestList() throws SQLException 
   //String track=guest.getTrackingNo("track"); 
      List guestList = new ArrayList(); 
GuestBean guest = new GuestBean(); 
      // obtain list of titles 
      String query="SELECT * FROM customer WHERE trackingNo='"+guest.getTrackingNo+"'"; 
ResultSet results = statement.executeQuery(query); 
while ( results.next() ) { 


          guestList.add( guest ); 
    return guestList; 

       protected void finalize() 
      // attempt to close database connection 
      try { 


      // process SQLException on close operation 
      catch ( SQLException sqlException ) { 
This is the jsp page code

<html xmlns = "http://www.w3.org/1999/xhtml"> 

      <title>Customer data</title> 

       <link rel = "stylesheet" href = "styles.css" 
         type = "text/css" /> 

      <p style = "font-size: 2em;">Customer Details</p> 

               <th style = "width: 100px;">Last name</th> 
               <th style = "width: 100px;">First name</th> 
               <th style = "width: 200px;">Tracking No</th> 
               <th style = "width: 100px;">Type of Parcel</th> 
               <th style = "width: 100px;">Destination</th> 
               <th style = "width: 300px;">Address</th> 
               <th style = "width: 100px;">Status</th> 
               <th style = "width: 100px;">Recievers Name</th> 
               <th style = "width: 200px;">Time Recieved</th> 
                <th style = "width: 200px;">Date Recieved</th> 


        <% // start scriptlet 

            List guestList = guestData.getGuestList(); 
            Iterator guestListIterator = guestList.iterator(); 
            GuestBean guest; 

            while ( guestListIterator.hasNext() ) { 
               guest = ( GuestBean ) guestListIterator.next(); 

         %> <%-- end scriptlet; insert fixed template data --%> 

                  <td><%= guest.getFirstname() %></td> 

                  <td><%= guest.getLastname() %></td> 


                        <%= guest.getTrackingNo() %></a> 
                  <td><%= guest.getParcel() %></td> 

                  <td><%= guest.getDestination() %></td> 


                        <%= guest.getAddress() %></a> 
                  <td><%= guest.getStatus() %></td> 

                  <td><%= guest.getReceiversname() %></td> 


                        <%= guest.getTimereceived() %></a> 
                   <td><%= guest.getDatereceived() %></td> 

         <% // continue scriptlet 

            } // end while 

         %> <%-- end scriptlet --%> 



stay alive
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
ExecuteNonQuery not giving proper result Lalit Pradhan ASP.NET 2.0 Professional 6 July 24th, 2008 02:00 AM
getting a result set to a vector cakalanka Java Databases 1 March 24th, 2008 07:33 AM
This piece of code is giving an error sourik C# 2 July 15th, 2006 09:18 AM
write result set bmains SQL Server 2000 11 March 9th, 2004 09:31 AM
Result set jemacc SQL Server 2000 0 December 19th, 2003 07:26 PM

All times are GMT -4. The time now is 02:15 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.