我想在成功執行代碼時將變量值傳遞給下一個jsp頁面。 請告訴我如何做到這一點。
我的代碼是:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("Jdbc:Odbc:swap");
int cnt=0;
pstmt=con.prepareStatement("select No from labSetting");
rs=pstmt.executeQuery();
while(rs.next())
{
cnt++;
}
rs.close();
pstmt.close();
con.close();
cnt++;
con=DriverManager.getConnection("Jdbc:Odbc:swap");
pstmt=con.prepareStatement("insert into labSetting values(?,?,?,?,?,?)");
pstmt.setInt(1,cnt);
pstmt.setString(2,lName);
pstmt.setString(3,sysId);
pstmt.setString(4,loc);
pstmt.setInt(5,1);
pstmt.setInt(6,1);
pstmt.executeUpdate();
pstmt.close();
con.close();
/************************************************
in this section i want to pass value of lName to the my home.jsp page
***********************************************/