search in Two Tables to Find data and view by jsp
hi i want search in Two Tables to Find data and view by jsp
<%@page import="java.sql.*"%>
<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"/>
View Answers
February 22, 2012 at 4:52 PM
February 22, 2012 at 9:04 PM
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 ");
}
February 23, 2012 at 7:25 AM
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
Ads
Related Tutorials/Questions & Answers:
search in Two Tables to Find data and view by jsp
search in
Two Tables to
Find data and
view by jsp hi i want
search in
Two Tables to
Find data and
view by
jsp
<%@page import...; Have a look at the following link:
JSP search using
two tables
 
Advertisements
Join the two tables in sql
Join the
two tables in sql How to join the
two tables in SQL ..and return the value from common column in SQL Database
Joins tables in jsp
Joins
tables in
jsp
When we want to select
data from
two or more
tables.... In this
example we have
two tables stu_info and stu_marks. Structure of
these
tables
View jsp
View jsp <%@ page language="java" contentType="text/html; charset...; charset=ISO-8859-1">
<title>
View ur Details</title>
</head>...;%=request.getContextPath()%>/Controller">
<input type="hidden" name="page" value="
view
add same tables in jsp page
add same
tables in
jsp page hi
I have a table in my
jsp page with
data, now I want to add same copy of table without its default value in same page whenever I click add more table, how do I do
SQL Server row comparison using two tables
SQL Server row comparison using
two tables insertion process are completed in table1.string comparison using table2 to table1 if any changes in these
tables and then upadated
how to do two database tables in one page?
how to do
two database
tables in one page? dear all:
i want to show these
two database
tables in one page. one table on the left (dbtable.jsp..." value="
Search">
</form>
</html>
***dbtable.jsp
Lucene Search in JSP - JSP-Servlet
Lucene
Search in JSP Hello Sir,
I want to Develop lucene -
Search engine in
Jsp page which can
Search full text from XML file..through XML parser..
Example:
in
Search interface there are one textbox after putting some value
Search Page in jsp
Search Page in jsp
search page in
jsp
Please go through the following links:
http://www.roseindia.net/
jsp/user-search.shtml
http://www.roseindia.net/servlets/search.shtml
Search page form in jsp
Search page form in jsp
search form in
jsp
Please go through the following links:
http://www.roseindia.net/
jsp/user-search.shtml
http://www.roseindia.net/servlets/search.shtml
search form in jsp
search form in jsp
search page in
jsp
Please go through the following links:
http://www.roseindia.net/
jsp/user-search.shtml
http://www.roseindia.net/servlets/search.shtml
JSP view detail page on accept button click
JSP view detail page on accept button click i Have 1
jsp page in that there r 2 button accept and
view details when we click on aceept button it will submit to next page and when click on
view details page it will shown the
data
find data science jobs
find data science jobs Hi,
I am beginner in
Data Science and machine learning field. I am searching for
the tutorials to learn:
find data... the
topic "
find data science jobs". Also tell me which is the good
JSP hide and show tables
JSP hide and show
tables
In this tutorial, you will learn how to hide and show html
tables using
javascript in
jsp. Here is an example of simple
jsp code which is having a table
consists of database
data and a Go button. Using
Purge Data from Mysql tables
Purge
Data from Mysql tables Hi,
i have to write a mysql procedure to purge
data from
tables.
but written procedure clear entire
tables data.
Please give me the solution for purging
data.
CREATE DEFINER=`root`@`localhost
Cross Join Tables in a Specific Database
join between
two
tables. The cross join operation retrieves
data between
two... and outer join operation. The
cross join is used to retrieve
data from
tables... will be performed between
two tables. Both
tables hold
some specific fields
ModuleNotFoundError: No module named 'data-view'
ModuleNotFoundError: No module named '
data-
view' Hi,
My Python... '
data-
view'
How to remove the ModuleNotFoundError: No module named '
data... have to install padas library.
You can install
data-
view python with following
ModuleNotFoundError: No module named 'data-view'
ModuleNotFoundError: No module named '
data-
view' Hi,
My Python... '
data-
view'
How to remove the ModuleNotFoundError: No module named '
data... have to install padas library.
You can install
data-
view python with following