Column select

Column select

How i fetch Experience wise resume?

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;ADS_TO_REPLACE_1 The select query retrieve the record value of specified column... Select data from Table in Database   
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
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.ADS_TO_REPLACE_1 for rename
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-ADS_TO_REPLACE_1 for drop
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 ExampleADS_TO_REPLACE_1
SET and SELECT
SET and SELECT  hello, What is difference between SET & SELECT in sql????   hii,ADS_TO_REPLACE_1 SET : The set statement is used to the update query. SELECT : The select statement is used to display the all
rename the column in sql
rename the column in sql   How can i rename the column name in SQL
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 query
select query  how to retrieve a single image from mysql table using $row[] value
ModuleNotFoundError: No module named 'column'
ModuleNotFoundError: No module named 'column'  Hi, My Python... 'column' How to remove the ModuleNotFoundError: No module named 'column'... to install padas library. You can install column python with following command
ModuleNotFoundError: No module named 'column'
ModuleNotFoundError: No module named 'column'  Hi, My Python... 'column' How to remove the ModuleNotFoundError: No module named 'column'... to install padas library. You can install column python with following command
SQL Alter Column Name
SQL Alter Column Name       Alter Column Name in SQL is used to change or modify the name of column... you a simple example on SQL Alter Column Name. In this Example, create
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 ExampleADS_TO_REPLACE_1 The Tutorial
sql add comment to column
sql add comment to column  Sql query to add comments to column
The SELECT statement for SQL
_TO_REPLACE_3 SELECT column_name(s) FROM table_name... of column names.ADS_TO_REPLACE_7 SELECT * FROM email... The SELECT statement for SQL     
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 ExampleADS_TO_REPLACE_1
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
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 newcolumnnameADS_TO_REPLACE_1 is not working
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
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><
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 ExampleADS
Excel Column change
Excel Column change  How to change sequence of columns in Excel sheet through Java
Mysql Alter Column
Mysql Alter Column       Mysql Alter Column is used to redefine the table and change the datatype of existing column. Understand with ExampleADS_TO_REPLACE_1 The Tutorial
SQL Add Column Int
SQL Add Column Int       SQL Add Column Int is used to add new column, whose field data type... The Tutorial illustrate a SQL Add Column Int example .In this Tutorial we create a table
MySQL Append Column
MySQL Append Column This example illustrates how to append two column value of a table. In this example create a select query to append the data of four column. Table
Select Statement in SQL, SQL Tutorial
_TO_REPLACE_3 SELECT column_name(s) FROM table_name... of column names.ADS_TO_REPLACE_7 SELECT * FROM email... The SELECT statement for SQL     
Delete a column
Delete a column       In this section, you will learn how to delete a column from database table...") @NamedQueries({ @NamedQuery(name="readAllRecords",query="SELECT
Changing column name
of column name:ADS_TO_REPLACE_2 mysql> select * from... Changing column name      ... the data in the form of rows and columns. Column indicates the field while row
How to display the data column on jsp
How to display the data column on jsp  My requirements: Display total error count of error description of each database server (column wise). like...); stmt=conn.createStatement(); query="select
SQL Alter Column
SQL Alter Column       SQL Alter Column modifies the existing table and add a column. Understand... Alter Column'. To understand and grasp this example, we create a table
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
Mysql Alter Rename Column
Mysql Alter Rename Column       Mysql Alter Rename Column is used to modify the table definition and rename the existing column of table. Understand with ExampleADS
MySQL Add Column
MySQL Add Column       MySQL Add Column tutorial explains you to add the column to the existing.... Understand with ExampleADS_TO_REPLACE_1 The Tutorial describes Add Column in MySQL
Mysql Alter Column
Mysql Alter Column       Mysql Alter Column is used to modify table and  change the existing column field name. Understand with ExampleADS_TO_REPLACE_1
Mysql Add Column Number
Mysql Add Column Number       Mysql Add Column Number is used to add the column to the existing table... 'Mysql Add Column Number'.To understand and grasp this example we create
adding some value to new column
adding some value to new column   how to update a column having some value into new column that also have some value i need to add this two value in java using result set we can get all the column data but how to add these value
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
SQL Alter Column type
SQL Alter Column type       Alter Column type in SQL is used to change or recreate the data type of existing column. Understand with ExampleADS_TO_REPLACE_1 The Tutorial
select query in mysql
select query in mysql  Select query in mysql. Can anyone
html:select in struts - Struts
html select in struts  What is the HTML select in struts default value
Select Clause in hibernate.
Select Clause in hibernate.  Example of select clause of hibernate
Select Clause in hibernate.
Select Clause in hibernate.  Example of select clause of hibernate
Select Clause in hibernate.
Select Clause in hibernate.  Example of select clause of hibernate
validate select option jquery
validate select option jquery  How to Validate select option in JQuery
struts2 select tag multiple
struts2 select tag multiple  struts2 select tag multiple

Ads