PROBLEM with using multiple PreparedStatement object
Hello friends
i have following code in which m using Two Statement Object's
<%@ page import="java.sql.*,com.example.model.*" session="true" %>
<%!
ResultSet rs1,rs2;
Statement stmt1;
Statement stmt2;
Connection con;
%>
<%
dbcon cn=new dbcon();
con=cn.connectdb();
try
{
stmt1=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
stmt2=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
rs1=stmt1.executeQuery("select mf_id,mf_lr_id from Manifest where mf_manifestno=604");
if(rs1.next())
{
do
{
int mfid=rs1.getInt("mf_id");
int lrid=rs1.getInt("mf_lr_id");
out.println(mfid);
out.println(lrid);
String getLr="Select lr_no from Lr_Tran where lr_id="+lrid; //lrid getting from outer query
rs2=stmt2.executeQuery(getLr);
out.println(getLr+"<br>");
if(rs2.next())
{
do{
out.println("<br>"+"hello");
out.println(rs2.getInt("lr_no"));
}while(rs2.next());
}
}while(rs1.next());
}
}catch(SQLException se)
{
-
}
%>
so its running fine but i hav tow queries
1>m using
stmt1=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
stmt2=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
n its working fine
but its not working when m using
stmt1=con.createStatement();
stmt2=con.createStatement();
why i clould'nt wrok with these line
2>as my above code is runnig fine with two Statemenrt Object
but i wana run above code with two PreparedStatement object then how is posible
plz help me soon

