Data Redundancy
Sorry for disturbing you again but there's redundancy of the selected data on this jsp u gif me. The selected data will appear twice at the drop down box. I've tried to fix it but still unable to do so. Is there anything can be done?
<%@ page language="java" import="java.util.*"%>
<%@ page import="java.sql.*,java.io.*,javax.servlet.*,javax.servlet.http.*,java.lang.String
"%>
<html>
<head>
<script type="text/javascript">
function change()
{
var answer = document.getElementById('selc').value;
window.location.replace("test.jsp?name="+answer);
}
</script>
</head>
<%
String connectionURL = "jdbc:mysql://localhost:3306/register";;
Class.forName("com.mysql.jdbc.Driver");
Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/test";, "root", "root");
String ans=request.getParameter("name");
response.setContentType("text/html");
String address = "";
String name = "";
try {
String sql = "select * from data where name = '"+ans+"'";
Statement s = connection.createStatement();
s.executeQuery (sql);
ResultSet rs = s.getResultSet();
while (rs.next ()){
address = rs.getString("address");
name=rs.getString("name");
}
rs.close ();
s.close ();
}
catch(Exception e){
System.out.println("Exception is ;"+e);
}
System.out.println(address);
%>
<body>
<h1>Use of Select Box in JSP</h1>
<table border="1" width="41%" height="53" cellspacing="0" cellpadding="3"
bgcolor="#000080" bordercolorlight="#FFFFFF">
<tr>
<td width="100%" height="18" colspan="2"><b>
<font color="#FF00FF">Select items from select box</font></b></td>
</tr>
<tr>
<td width="17%" height="23">
<select onChange="change();" id="selc" >
<%
Statement st=connection.createStatement();
ResultSet rs=st.executeQuery("select name from data");
while(rs.next()){
%>
<option value="<%=rs.getString("name")%>"><%=rs.getString("name")%></option>
<%
if(name.equals(rs.getString("name"))){
%>
<option value="<%=rs.getString("name")%>"selected=selected><%=rs.getString("name")%>></option>
<%
}
}%>
</select>
</td>
<td width="83%" height="23"><input type="text" id="textvalue" value="<%= address %>" />
</td>
</tr>
</table>
</body>
</html>
View Answers
Related Tutorials/Questions & Answers:
Data Redundancy - JSP-Interview QuestionsData Redundancy Sorry for disturbing you again but there's
redundancy of the selected
data on this jsp u gif me. The selected
data will appear twice at the drop down box. I've tried to fix it but still unable to do so
CRC(cyclic redundancy check) - UMLCRC(cyclic
redundancy check) write a program that accepts a
data sequence , generates a fcs (using a known divisor) and then ultimately check whether the recieved
data is in error
Advertisements
datadata
data Handling AOP
datadata Handling
data in AOP
datadata handling examples in AOP Model
data handling examples in AOP Model
What is VRRP?;
VRRP the acronyms of Virtual Router
Redundancy Protocol
is ...; the data while
data transmission as it works as a
switching system... be another sort of problem, not in the VRRP system. All
the
data has been
importing data and edit that data importing
data and edit that
data hello sir i have
data in excel sheet which contain 2 rows and i want to import that
data to ms access and edit that
data like adding new columns and new rows and creating new tables
big data data sciencebig
data data science Hi,
I am beginner in
Data Science and machine learning field. I am searching for
the tutorials to learn:
big
data data... the
topic "big
data data science". Also tell me which is the good
data science and data miningdata science and
data mining Hi,
I am beginner in
Data Science and machine learning field. I am searching for
the tutorials to learn:
data science and
data mining
Try to provide me good examples or tutorials links so that I
data mining data sciencedata mining
data science Hi,
I am beginner in
Data Science and machine learning field. I am searching for
the tutorials to learn:
data mining
data science
Try to provide me good examples or tutorials links so that I can
big data and data sciencebig
data and
data science Hi,
I am beginner in
Data Science and machine learning field. I am searching for
the tutorials to learn:
big
data and
data science
Try to provide me good examples or tutorials links so that I can
data science and data analyticsdata science and
data analytics Hi,
I am beginner in
Data Science and machine learning field. I am searching for
the tutorials to learn:
data science and
data analytics
Try to provide me good examples or tutorials links so
data science data analyticsdata science
data analytics Hi,
I am beginner in
Data Science and machine learning field. I am searching for
the tutorials to learn:
data science
data analytics
Try to provide me good examples or tutorials links so that I
data visualization in data sciencedata visualization in
data science Hi,
I am beginner in
Data Science and machine learning field. I am searching for
the tutorials to learn:
data visualization in
data science
Try to provide me good examples or tutorials
What is Big Data and Data miningWhat is Big
Data and
Data mining Hi,
Big
Data,
Data Mining and
Data analytics are hot topic these days.
What is Big
Data and
Data mining?
Thanks
What is Big Data and Data miningWhat is Big
Data and
Data mining Hi,
Big
Data,
Data Mining and
Data analytics are hot topic these days.
What is Big
Data and
Data mining?
Thanks
data processing is data processing is
data processing is
Data processing is associated with commercial work.
Data processing is also referred as Information System.
Data processing is basically used for analyzing, processing
data tyape data tyape please give me
data type of Date
data tyape data tyape please give me
data type of Date
data tyape data type of Date please give me
data type of Date
data tyape data tyape please give me
data type of Date
Data Normalization
Data Normalization
In this section you will learn the concepts of
data normalization. The most important
thing in database designing is to make sure that the
data get
properly
data typedata type which
data type is used to store video file in mysql databse
data tyape What
data tyape a date field req in SQL please give me
data type of Date
data tyape data type of date in mysql please give me
data type of Date
data wrangling vs data miningdata wrangling vs
data mining Hi,
I am beginner in
Data Science and machine learning field. I am searching for
the tutorials to learn:
data wrangling vs
data mining
Try to provide me good examples or tutorials links so
data science and big data analyticsdata science and big
data analytics Hi,
I am beginner in
Data...:
data science and big
data analytics
Try to provide me good examples or tutorials links so that I can learn the
topic "
data science and big
data certificate in big data and data analyticscertificate in big
data and
data analytics Hi,
I am beginner in
Data Science and machine learning field. I am searching for
the tutorials to learn:
certificate in big
data and
data analytics
Try to provide me good examples
Is big data necessary for data science?Is big
data necessary for
data science? Hi,
I am beginner in
Data...:
Is big
data necessary for
data science?
Try to provide me good examples or tutorials links so that I can learn the
topic "Is big
data necessary
Is big data and data science same?Is big
data and
data science same? Hi,
I am beginner in
Data...:
Is big
data and
data science same?
Try to provide me good examples or tutorials links so that I can learn the
topic "Is big
data and
data science same?"
Is Data Analyst same as data scientist?Is
Data Analyst same as
data scientist? Hi,
I am beginner in
Data...:
Is
Data Analyst same as
data scientist?
Try to provide me good examples or tutorials links so that I can learn the
topic "Is
Data Analyst same as
data data wrangling vs data cleaningdata wrangling vs
data cleaning Hi,
I am beginner in
Data Science and machine learning field. I am searching for
the tutorials to learn:
data wrangling vs
data cleaning
Try to provide me good examples or tutorials links so
Data objects Data objects hello,,
What are
data objects?
hii,ADS_TO_REPLACE_1
Sequences, Views, clusters, Tables, index and cluster are called
data objects for a database
data sciencedata science Hi,
I am beginner in
Data Science and machine learning field. I am searching for
the tutorials to learn:
data science
Try...;
data science". Also tell me which is the good training courses in Machine
data sainsdata sains Hi,
I am beginner in
Data Science and machine learning field. I am searching for
the tutorials to learn:
data sains
Try to provide me good examples or tutorials links so that I can learn the
topic "
data data degreesdata degrees Hi,
I am beginner in
Data Science and machine learning field. I am searching for
the tutorials to learn:
data degrees
Try...;
data degrees". Also tell me which is the good training courses in Machine
be data sciencebe
data science Hi,
I am beginner in
Data Science and machine learning field. I am searching for
the tutorials to learn:
be
data science
Try... "be
data science". Also tell me which is the good training courses
data typesdata types Write a short note on
data types of Java.
Please visit the following link:
Java datatypes
Data Generator
Data Generator
Data Generator is free open source script that is
designed to create the application, which can be used to generate a large sum of
data...
JavaScript, PHP and MySQL.
Characteristics
Data
generator is browser
Split DataSplit Data how to split
data from to from
e.g. sssss-3100@jdkck
i want only 3100
data from that string
kaggle datakaggle data Hi,
I am beginner in
Data Science and machine learning field. I am searching for
the tutorials to learn:
kaggle
data
Try to provide...
Learning, Artificial Intelligence and
Data Science for beginners.
Thanks
degree datadegree data Hi,
I am beginner in
Data Science and machine learning field. I am searching for
the tutorials to learn:
degree
data
Try to provide...
Learning, Artificial Intelligence and
Data Science for beginners.
Thanks
ms in datams in data Hi,
I am beginner in
Data Science and machine learning field. I am searching for
the tutorials to learn:
ms in
data
Try to provide..., Artificial Intelligence and
Data Science for beginners.
Thanks
python datapython data Hi,
I am beginner in
Data Science and machine learning field. I am searching for
the tutorials to learn:
python
data
Try to provide...
Learning, Artificial Intelligence and
Data Science for beginners.
Thanks
introduction to dataintroduction to data Hi,
I am beginner in
Data Science and machine... to
data
Try to provide me good examples or tutorials links so that I can learn... courses in Machine
Learning, Artificial Intelligence and
Data Science
masters in datamasters in data Hi,
I am beginner in
Data Science and machine learning field. I am searching for
the tutorials to learn:
masters in
data
Try... in Machine
Learning, Artificial Intelligence and
Data Science for beginners.
Thanks
r for datar for data Hi,
I am beginner in
Data Science and machine learning field. I am searching for
the tutorials to learn:
r for
data
Try to provide..., Artificial Intelligence and
Data Science for beginners.
Thanks
coursera datacoursera data Hi,
I am beginner in
Data Science and machine learning field. I am searching for
the tutorials to learn:
coursera
data
Try...
Learning, Artificial Intelligence and
Data Science for beginners.
Thanks
course datacourse data Hi,
I am beginner in
Data Science and machine learning field. I am searching for
the tutorials to learn:
course
data
Try to provide...
Learning, Artificial Intelligence and
Data Science for beginners.
Thanks