You should use JSDK 2.1 instead of JSDK 2.0
Look into API docs for these methods

n> hi everyone,

n> I have written a servlet program,which creates a resultset,
n> and fwd to a jsp page which shall display the records.
n> The problem is that iam not able to compile the java program.
n> The source and error message is below  ..
n> is there some other jar files that have to be included in class path...
n> any help would be greatly appreciated.
n> iam using jdk1.2.

n> rds,
n> naveen

n> *********************
n> import java.io.*;
n> import java.util.*;
n> import java.sql.*;
n> import javax.servlet.*;
n> import javax.servlet.http.*;


n> public class Resultsets extends HttpServlet {

n> Connection PubCon;
n> ResultSet PubRset=null;
n> Statement Pubstmt;
n> public String PubSql="";
n> public String redata;
n> ResultSetMetaData PubRsetMdata;
n> public String strhtml;
n> public String surveyName;

n>  public void doPost (HttpServletRequest req, HttpServletResponse res)
n>    throws ServletException, IOException
n>     {

n>  try
n>     {
n>   DbConnect();
n>     }
n>  catch(Exception Exc)
n>       {
n>   strhtml += "Not able to connect to DB";
n>       }

n>  req.setAttribute("rs",PubRset);
n>  RequestDispatcher rd =
n> getServletContext().getRequestDispatcher("/jsp/myapp/results.jsp");
n>  rd.forward(req,res);


n>  }

n> public void DbConnect()
n> {

n>  try{
n>  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
n>  Connection c = DriverManager.getConnection("jdbc:odbc:naveen","dba","sql");
n>  Statement st=c.createStatement();
n>  PubRset=st.executeQuery("Select Name,ID,Place,Dgn from employee");
n>     }
n>  catch(Exception ex)
n>  {
n>   strhtml="wrong sql execution";
n>  }
n> }

n> }

n> ***********************
n> Error:

n> C:\JSDK2.0\examples\Resultsets.java:32: Method
n> setAttribute(java.lang.String, java.sql.ResultSet) not found in interface
n> javax.servlet.http.HttpServletRequest.
n>  req.setAttribute("rs",PubRset);
n> C:\JSDK2.0\examples\Resultsets.java:33: Method
n> getRequestDispatcher(java.lang.String) not found in interface
n> javax.servlet.ServletContext.
n>  RequestDispatcher rd =
n> getServletContext().getRequestDispatcher("/jsp/myapp/results.jsp");
n>                                                                 ^

Best regards,
 Artyom
[EMAIL PROTECTED]

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to