Share on Google+Share on Google+

Ankit Kumar
Column select
1 Answer(s)      4 years and 9 months ago
Posted in : JSP-Servlet

How i fetch Experience wise resume?

Ads

View Answers

July 10, 2012 at 4:06 PM


Create a column experience which consist of only two values either yes or no. Then using the query select * from resumes where experience='yes', fetch all the data of the corresponding candidate.

<[email protected] language="java"%>
<[email protected] import="java.sql.*"%>
<table border="1">
<%
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "root");
String query = "select * from candidates where experience='yes'";
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery(query);
if(rs.next()){
%>
<tr>
<tr><td>Name</td><td><input type="text" name="name" value="<%=rs.getString("name")%>"></td></tr>
<tr><td>Address</td><td><input type="text" name="address" value="<%=rs.getString("address")%>"></td></tr>
<tr><td>Contact No</td><td><input type="text" name="contact" value="<%=rs.getInt("contactNo")%>"></td></tr>
<tr><td>Email</td><td><input type="text" name="email" value="<%=rs.getString("email")%>"></td></tr>
<%
}
}
catch(Exception e){}
%>
</table>

OR Create a column experience which consist of integer values, shows how many years of experience does candidate have. Then using the query Select * from candidates order by experience ASC, fetch all the data of the corresponding candidate. This query fetches the data according to the increasing order of experience, means having 0 years of experience should comes first. And if you want to display the candidates list based on experience from most experienced to fresher, then use this query Select * from candidates order by experience DESC.

<[email protected] language="java"%>
<[email protected] import="java.sql.*"%>
<table border="1">
<%
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "root");
String query = "Select * from candidates order by experience ASC";
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery(query);
if(rs.next()){
%>
<tr>
<tr><td>Name</td><td><input type="text" name="name" value="<%=rs.getString("name")%>"></td></tr>
<tr><td>Address</td><td><input type="text" name="address" value="<%=rs.getString("address")%>"></td></tr>
<tr><td>Contact No</td><td><input type="text" name="contact" value="<%=rs.getInt("contactNo")%>"></td></tr>
<tr><td>Email</td><td><input type="text" name="email" value="<%=rs.getString("email")%>"></td></tr>
<%
}
}
catch(Exception e){}
%>
</table>









Related Tutorials/Questions & Answers:
Column select
Column select   How i fetch Experience wise resume?   Create a column experience which consist of only two values either yes or no. Then using the query select * from resumes where experience='yes', fetch all the data
How to align the select tags in a single column.
How to align the select tags in a single column.  I am developing a JSP page with struts tags. In the JSP page I have a form where the candidate... are being displayed in three different rows but I want them in the same column
Advertisements
Select data from Table in Database
; in simple select statement is given below select column name from table; The select query retrieve the record value of specified column in the syntax from table. select * from table; The select query retrieve all the column present
column matrix
column matrix  columan wise total matrix
column matrix
column matrix  columan wise total matrix
Blob column
Blob column  Hi all... How to store an excel file in Blob column? I m using oracle 11 g database
SET and SELECT
SET and SELECT  hello, What is difference between SET & SELECT in sql????   hii, SET : The set statement is used to the update query. SELECT : The select statement is used to display the all data's in the table
select query
select query  how to retrieve a single image from mysql table using $row[] value
select query
select query  how to write select query with where clause having multiple variables. example: i want to select the data from DB in which i want to check againest two variable in where cluase. String sql = "select * from
How to Delete a column and Add a new column to database
How to Delete a column and Add a new column to database   How to Delete a column and Add a new column to database   Hi, The following query is executed for add and delete a column in a table- for drop a column
how to Change column name and Make a unique column.
how to Change column name and Make a unique column.   how to Change column name and Make a unique column.   Hi, Following queries are used to rename a column and to make a column unique. for rename a column- alter
Select from select list + display
Select from select list + display  i have a select list containing... select EmpCode from the select list, the corresponding EmpName and DeptName should...;/div> <tr><td><b>Select:</b></td><td><
Hibernate Column
This tutorial explains the concept of column annotation in hibernate
SQL Alter Column Name
SQL Alter Column Name       Alter Column Name in SQL is used to change or modify the name of column in a table. Understand with Example The Tutorial explain you
rename the column in sql
rename the column in sql   How can i rename the column name in SQL
sql add comment to column
sql add comment to column  Sql query to add comments to column
SQL Alter Column Name
SQL Alter Column Name       Alter Column Name in SQL is used to change or modify the name of column... example on SQL Alter Column Name. In this Example, create a table 'Stu_Table
Mysql Alter Column Size
Mysql Alter Column Size       Mysql Alter Column Size is used to change the data size of a column in a table. Understand with Example The Tutorial illustrate an example
Altering a Column name in a table
Altering a Column name in a table  how to alter column name in MSSQL server 2005 the codesample given using "change" keyword alter table tablename change oldcolumnname to newcolumnname is not working
The SELECT statement for SQL
The SELECT statement for SQL       SELECT key word is used to select data from a table.  Syntax:           SELECT column_name(s
Excel Column change
Excel Column change  How to change sequence of columns in Excel sheet through Java
how I do select from select in hql
how I do select from select in hql  select RN from ( select rownum RN, dbid from ( select * from profile p where type = 1912 and name like... doesn't work select RN from ( select rownum RN, DBId from ( select distinct p
Mysql Alter Column
Mysql Alter Column       Mysql Alter Column is used to redefine the table and change the datatype of existing column. Understand with Example The Tutorial illustrate an example
SQL Add Column Int
SQL Add Column Int       SQL Add Column Int is used to add new column, whose field data type is integer.  Understand with Example The Tutorial illustrate a SQL Add Column
Mysql Alter Remove Column
Mysql Alter Remove Column       Mysql Alter Remove Column is used to redefine the table and remove the column from existing table. Understand with Example The Tutorial
column count using metadata
GET COLUMN COUNT USING "RESULTSETMETADATA"   In this program ,we will get column count using "resultsetmetadata ".Using resultset interface and metadata interface ,we can get properties of column
Count number of characters in a column.
Count number of characters in a column.  I just need you suggestions. Am from Biology Back ground. I just need to find out number of characters in a column i.e, if i have a file with text in this manner ACGT GCTA GCTA i need
SQL Alter Column
SQL Alter Column       SQL Alter Column modifies the existing table and add a column. Understand with Example The Tutorial illustrate an example from 'SQL Alter Column
struts2 select tag multiple
struts2 select tag multiple  struts2 select tag multiple
validate select option jquery
validate select option jquery  How to Validate select option in JQuery
select query in mysql
select query in mysql  Select query in mysql. Can anyone
Tutorials   
Java Spring Hibernate Struts Training fat image from db fat image from db fat image from db fat image from db unable to get value returned from javascript variable in page How to change image size before adding to mysql using jsp Design a registration.jsp page with input for user registration details Cart Quantity jsp servlet coding issue servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? image pdf marking pdf marking Multiple image upload using JSP Read code from excel sheet and upload into database using JSP Student java about search engine Convert BLOB to PDF and save it to a location how to copy files from remote to local machine using SFTP SSL in java? Like Team viewer Socket and Servert -Jsp how to copy files from remote location to local using java? How To Store Multilple Images In MySQL database dynamically with image uploader and then retrieve them in image gallery using java how to create SOAP based web service in java? how to fetch data from mysql database table and draw a bar chart on that data using in jsp how to create users in LDAP using java? how to authenticate user using TIVOLI api in java? how to create users using IBM Tivoi API in jsp/servelet? Java/J2ee Please explain this code as many packages and classes are unknown to me .! how to download the uploaded folder files using jsp Login Query image is display from path of mysql database please reply the code to store dynamic fields in database? Reloading issue in jsp How to get Button Id ? calling one jap page from another jsp page login login Problem to get connection from DAO class to JDBC Page Loading Time Fix table's column's name row(1st row of the table) so that it does not move up when the table is scrolled up to view more rows below Sending hidden values

Ads

 
Advertisement null

Ads