why the program is showing error?

why the program is showing error?

<%@page import="java.sql.*"%>

<%
try{
Connection conn = null;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
conn = DriverManager.getConnection("jdbc:odbc:sample");
Statement st=null;
st=conn.createStatement();
String query = "select * from projection";
ResultSet rs=st.executeQuery(query);

Statement st1=null;
st1=conn.createStatement();
Statement st2=null;
st2=conn.createStatement();


while(rs.next())
{
    String catsid=rs.getString(3);
    String empid=rs.getString(2);
    String query1="select *from CATS_Dump where PersonNo='"+catsid+"' ";
    out.println("hi");
    try{
    ResultSet rs1=st1.executeQuery(query1);
    }catch(Exception e1)
    { e1.printStackTrace();}
    out.println("hi");

    Integer i=0;
    out.println("hi");

    while(rs1.next())
    {
        Integer k=Integer.parseInt(rs1.getString(10));
        i=i+k;
    }

    st2.executeUpdate("update dft set Actual_CFTE='"+i+"' where EmployeeId='"+empid+"' "); 

}
}
catch(Exception e){
System.out.println(e);
}


%>

It is showing the error:

An error occurred at line: 33 in the jsp file: /sampledft.jsp
rs1 cannot be resolved
30:     Integer i=0;
31:     out.println("hi");
32: 
33:     while(rs1.next())
34:     {
35:         Integer k=Integer.parseInt(rs1.getString(10));
36:         i=i+k;


An error occurred at line: 35 in the jsp file: /sampledft.jsp
rs1 cannot be resolved
32: 
33:     while(rs1.next())
34:     {
35:         Integer k=Integer.parseInt(rs1.getString(10));
36:         i=i+k;
37:     }
38:     
View Answers

Ads









Related Tutorials/Questions & Answers:
why the program is showing error?
errore
Advertisements
Java Program Errors
Any specific log4j statements for Hibernate Envers for showing the Envers related errors
Java is an opensource program or not? why???
why java program not run with msword editor
Why is my program running an infinite loop? Parallel Arrays Program
errors
java find the error1
java find the error4
java find the error7
java find the error3
java find the error2
java find the error5
for writting java program why we are taking more than one class
Runtime Errors
why and where we use setter and getter methods in java, please give me one example program.....
Showing div at the center of the webpage
Is it modify Object data? Generally Object data can't modify............but in this program it modifies.......... Why?
ModuleNotFoundError: No module named 'errors'
showing the information of database in textbox
What is the errors?
Need urgent help with C++ errors!
Servlets errors in same page.
compiled but showing below error
types of errors in php
compilation errors
jframe background color not showing
ModuleNotFoundError: No module named 'django-errors'
ModuleNotFoundError: No module named 'edeposit.amqp_errors'
ModuleNotFoundError: No module named 'haiku-errors'

Ads