Try:

<table>
<tr>
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
  Connection yourConn =
DriverManager.getConnection("jdbc:odbc:your_dsn","usrname","passwd");
        Statement stmt = yourConn.createStatement();
        ResultSet yourResultSet = stmt.executeQuery("Select *
from your_table");

if (yourResultSet != null) {
        while (yourResultSet.next()) {
        String a = yourResultSet.getString(1);
        (so on and so on....)

%>

<td><%= a %>
(so on and so on...)
</tr>
</table>

<%
        } /*close while
     } /*close if

   stmt.close();
   myConn.close();
%>

"(1)" as place holder in parameter (but 1 could be
anything, make sure syntax is correct though), display
value "a". this is basically what i do and it works.
hope this helps.




--- Sanjay Vashisht <[EMAIL PROTECTED]> wrote:
> You cannot pass a parameter to the getString( )
> method. Remove the
> parameter
> passed, before retrieving just have a reference of
> Metadata interface
> for recordset
> and traverse  through recordset using rs.next().
>
> Rgds
>
> Sanjay
>
> Modassir Sattar wrote:
>
> > Hi,
> >
> > I am trying to execute a query in a JSP page, but
> I am getting a page full
> > of errors.
> > The code is working fine upto the
> executeQuery("select * from sss")
> > statement, but when I tried to disply the
> recordset using
> > rs.getString("Name") these errors are displayed.
> >
> > I am using IBM's WebSphere server and DB2
> Database, and I used jdbc.odbc
> > bridge to access the database.
> >
> > Does any body know what I am doing wrong.
> >
> > Your help is appreciated.
> >
> > Thanks.
> >
> > Modassir
> >
> >
>
===========================================================================
> > To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> > Some relevant FAQs on JSP/Servlets can be found
> at:
> >
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__________________________________________________
Do You Yahoo!?
Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free!
http://photos.yahoo.com/

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to