Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSP-Servlet Column select
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


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


How i fetch Experience wise resume?


Advertisement
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.

<%@page language="java"%>
<%@page 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.

<%@page language="java"%>
<%@page 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
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 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
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
Excel Column change
Excel Column change  How to change sequence of columns in Excel sheet through Java
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
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
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 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
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
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
Mysql Alter Add Column
Mysql Alter Add Column       Mysql Alter Add Column is used to define the existing Table and add a new column to it. Understand with Example
SQL Add Column Int
SQL Add Column Int       SQL Add Column Int is used to add new column, whose field data type... a SQL Add Column Int example .In this Tutorial we create a table Stu_Table using
MySQL Add Column
MySQL Add Column       MySQL Add Column tutorial explains you to add the column to the existing.... Understand with Example The Tutorial describes Add Column in MySQL. To understand
Advertisements
 

 

 

DMCA.com