Hi Nor'ain Bte Hassan

I came across the same problem few days back...
I was retrieveing the records by using the select * from some table
but one field was 3000 characters in one column of the db...
the servlet's query was failing....
instead of * use all the field names or if a particular filed is long enough
then for that field use ltrim(rtrim) if the records to be extracted are
more.....

I hope it will work.....

Regards
Hemant

-----Original Message-----
From: No Rain [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 11, 2000 11:02 AM
To: [EMAIL PROTECTED]
Subject: Fwd: Undelivered mail


>From: LISTSERV SMTP interface <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Undelivered mail
>Date: Tue, 10 Oct 2000 22:12:36
>
>An error was detected while processing the enclosed message. A list of
>the affected recipients follows. This list is in a special format that
>allows LISTSERV to automatically take action on incorrect addresses.
>
>--> Error description:
>Error-For:  [EMAIL PROTECTED]
>Error-Code: 3
>Error-Text: 550 5.1.1 <[EMAIL PROTECTED]>... User unknown
>
>Error-End:  1 error(s) reported
>
>----------------------------- Undelivered message
>-----------------------------
>Date:         Tue, 10 Oct 2000 22:12:36 -0700
>From:         Nor'ain Bte Hassan <[EMAIL PROTECTED]>
>Subject:      help urgent!pls troubleshoot.
>To:           [EMAIL PROTECTED]
>
>hello to everyone out there;
>this is part of my program.i dont seem to know what's wrong with it.there
>is no problems when i compile but when i run the servlet i did not get the
>result i wanted.the query does not return any result when executed.
>when i tried using the same sql in a program using application i can get
>the results i wanted.
>i am required to write the program in servlet and i dont know which part in
>this part of the program is wrong!
>
>pls help its urgent!!!!!!!
>
>
>
>
>
>
>
>
>  public void doPost ( HttpServletRequest req,
>                        HttpServletResponse res )
>       throws ServletException, IOException
>
>   {
>         String g_modcd;
>         String g_admno;
>         String g_coursecd;
>         String g_moddesc;
>         String g_staffname;
>         String g_acttype;
>
>
>         String Lec[];
>  int lec_count = 0;
>
>         String Tut[];
>         int tut_count = 0;
>
>         String Pra[];
>         int pra_count = 0;
>
>         Lec = new String[10];
>         Tut = new String[10];
>         Pra = new String[10];
>
>         g_modcd = new String("EG1003");
>         g_admno = new String("991899X");
>        g_coursecd = new String("EDGF07");
>         g_moddesc = new String("ELECTRICAL PRINCIPLES");
>         g_acttype = new String("");
>
>
>         PrintWriter output = res.getWriter ();
>         res.setContentType( "text/html" )
>         output.println("<HTML><HEAD><TITLE>");
>                        output.println("Course Feedback for Electrical
>Principles And Circuits");
>
>                        output.println("</TITLE></HEAD><BODY>");
>
>                        output.println("Course Code:");
>                        output.println(g_coursecd);
>
>                        output.println("<BR>Module Name:");
>                        output.println(g_moddesc);
>
>
>                        output.println("<BR>Module Code:");
>                        output.println(g_modcd);
>
>
>            try{
>
>
>                   Statement stmt = connection.createStatement();
>                   ResultSet result = stmt.executeQuery("SELECT * FROM
>StudentModule INNER JOIN (Staff INNER JOIN StaffModule ON Staff.STAFFID =
>StaffModule.STAFFID) ON StudentModule.MODGRP = StaffModule.MODGRP WHERE
>ADMNO = '991899X' AND StudentModule.MODCD= 'EG1003' ");
>
>
>                    while (result.next())
>
>    {
>     //print the values for the current row
>
>      g_coursecd = result.getString("COURSECD");
>                                  g_moddesc = result.getString("MODDESC");
>      g_modcd = result.getString("MODCD");
>     g_staffname = result.getString("STAFFNAME");
>                                  g_accttype = result.getString( "ACTTYPE"
>);
>
>
>
>                        if(g_acttype.equals("L"))                   {
>    Lec[lec_count] = g_staffname;
>    //output +="\nLecturer name is:" + Lec[lec_count ];
>                         lec_count += 1;
>                        }
>
>
>                        if(g_acttype.equals("T"))
>    {
>     Tut[tut_count] = g_staffname;
>    //output +="\nTutor name is:" +Tut[tut_count];
>            tut_count += 1;
>    }
>
>    if(g_acttype.equals("P"))
>           {
>     Pra[pra_count] = g_staffname;
>    //output += "\nPractical name is:" +Pra[pra_count] ;
>                          pra_count += 1;
>    }
>
>
>
>                                 output.println("<BR>Lecturer:");
>                                 output.println(g_staffname);
>
>                                 output.println("<BR>Tutor[Tutorial]:");
>                                 output.println(g_staffname);
>
>                                 output.println("<BR>Tutor[Practical]");
>                                 output.println(g_staffname);
>
>                         }
>
>
>
>               output.println("<input type=submit value="+"Previous"+">");
>               output.println("<input type=submit value="+"Next"+">");
>               output.println("<input type=submit value="+"Quit"+">");
>               output.println("</BODY></HTML>");
>
>
>
>            output.close();
>            stmt.close();
>            result.close();
>
>  }
>
>
>        catch(Exception e)
>                  {
>
>                    System.err.println("ERROR!Unable to proceed");
>                    e.printStackTrace();
>
>                  }
>
>
>
>   }

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at
http://profiles.msn.com.

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to