<table bord" name="description">

hi i want search in Two Tables to Find data and view by jsp
<table border="1">
<h2>Citizen account</h2>
<tr><td></td>
<td><b><u>Name</u></b></td>
<td><b><u>Account Number</u></b></td>
<td><b><u>Amount</u></b></td>
</tr>
<%
String acnumber =request.getParameter("acnumber");
try{
Connection conn = null;
Class.forName("com.mysql.jdbc.Driver").newInstance();
%>
<%
conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/KDatabase","root","");
ResultSet rs = null;
Statement st=null;
%>
<%
st=conn.createStatement();
rs = st.executeQuery("select * from electricity where accountno='"+acnumber+"'");
if(rs=accountno){
int i=0;
while(rs.next()){
%>
<tr>
<td> </td>
<td><%= rs.getString("name") %></td>
<td><%= rs.getString("accountno") %></td>
<td><%= rs.getString("amount") %></td>
</tr><%
i++;
}
}else st=conn.createStatement();
rs = st.executeQuery("select * from electricity where accountno='"+acnumber+"'");
int i=0;
while(rs.next()){
%>
<tr>
<td> </td>
<td><%= rs.getString("name") %></td>
<td><%= rs.getString("accountno") %></td>
<td><%= rs.getString("amount") %></td>
</tr><%
i++;
}
}catch(SQLException e){
System.out.println(e.getMessage());
}
%>
<jsp:include page="footcitilogin.jsp"/>

sorry my friend this is another issue, I want like
if found in first table print the row else go to second table.
rs = st.executeQuery("select * from electricity where accountno='"+acnumber+"'");
if(rs != null){ // If find it print("you paid") If not go next step
out.println("you paid"+ rs);
}else if(rs == null) { // here must print ("you must paying bill")
rs = st.executeQuery("select * from paying where accountno='"+acnumber+"'");
out.println(" you must pay ");
}

i want to write payment bill code (create two table the first table: the bills for user the admin insert in this table the second table: when the user pay insert in this table he has paid )
1-the user write account number and submit 2-the process search in the second table if he has paid give him message you have paid if not found it then search in the second table it must be there and view the bill for the user
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.