Home Answers Viewqa JSP-Servlet Column select

 
 


Ankit Kumar
Column select
1 Answer(s)      10 months ago
Posted in : JSP-Servlet

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 Pages:
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
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
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
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... Alter Column Size'. To understand example we create table 'employees
sum database column
for you. select item, sum(quqantity) from `order` group by item
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
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
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 st FROM Student
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 illustrate
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 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 The Tutorial
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
Changing column name
the column name: mysql> select * from... Changing column name      ... the data in the form of rows and columns. Column indicates the field while row
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 Example The Tutorial brings you
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
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 Example The Tutorial
Mysql Alter Column
Mysql Alter Column       Mysql Alter Column is used to modify table and  change the existing column field name. Understand with Example The Tutorial illustrate an example from
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
runtime error:Invalid column name
runtime error:Invalid column name  Hello, Can anyone please help me...(); Query = "select t.TopicName, p.NumberofPolls from EMS_Topic t,EMS_Poll p where...; } } Console Output: Getting Results! java.sql.SQLException: Invalid column name
SQL SELECT DISTINCT Statement
to overcome the duplicate values from a column, we will use SELECT DISTINCT... SQL SELECT DISTINCT Statement     ... with the select statement. The SQL Distinct clause is used with the Select statement
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 Example The Tutorial brings you
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
Retrieval column details into respective JComboboxs
Retrieval column details into respective JComboboxs   Hello sir, As of now i created program in the Eclipse the GUI window .I had creaated... in there respective comboboxs.. and if i select other name name in the PNAME(shruthi
SQLException:Column not found? (help me:(
SQLException:Column not found? (help me:(  import javax.swing....; selectString ="select*from stock"; try...(); searchString ="select * from stock where Stock_Code ="+code1
MySQL Add Column
The Tutorial describe Add Column in MySQL. To understand the example we use select... MySQL Add Column       MySQL Add Column is used to add the column to the existing table
MySQL Add Column
describe Add Column in MySQL. To understand the example we use select query... MySQL Add Column       MySQL Add Column is used to add the column to the existing table. The Alter table
Jdbc Get Column Names
Jdbc Get Column Names       The JDBC Get Column Names return you the property of the retrieved Column like its field name and data type using meta Data. Understand with Example
Deleting row and column from a table
Deleting row and column from a table  In this program ,we delete row and column of a table. First we create connection to a database using... " keyword and also can delete column using "Alter" table commands
Select Statement in SQL, SQL Tutorial
The SELECT statement for SQL       SELECT key word is used to select data from a table.  Syntax:           SELECT column_name(s
Mysql Alter Column Datatype
Mysql Alter Column Datatype       Mysql Alter Column Datatype is used to modify the table and change... of table 'employee1' we use select query that return the detail of records
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
Using Select Statements in JDBC
and Name is one of the column of table. By the SELECT Statement we can retrieve... Using Select Statements in JDBC    The SELECT statement is used to select data from a table. For terminating
SQL SELECT DISTINCT Statement
to overcome the duplicate values from a column, we will use SELECT DISTINCT... SQL SELECT DISTINCT Statement     ... with the select statement. The SQL Distinct clause is used with the Select statement
Mysql Alter Column Primary Key
Mysql Alter Column Primary Key       Mysql Alter Column Primary Key is used to modify table and redefine the Primary Key Column in a table. Understand with Example The Tutorial
MySQL Select Statement
list of column names. By the following example you select Name, City and Age... MySQL Select Statement       In this lesson you will be learn how to use SELECT
Hibernate SELECT Clause
Hibernate SELECT Clause In this tutorial you will learn how to use HQL select clause. Use of SELECT clause in hibernate is as same as it used in SQL... example which will demonstrate you how a HQL select clause can be used. To achieve
select maximum time entry row - JDBC
select maximum time entry row  Hi fried you given ans this Sql Query for select maximum value max() function use. "select max(fieldname) from tablename" but this query only for find a max value of that column
Enabling Row, Column and Cell Selections in a JTable
. If you want to select only one cell you have to enable both row and column... Enabling Row, Column and Cell Selections in a JTable... to describe how to enable the row, column and cell selections in a JTable
Get Column names using Metadata in jsp
Get Column names using Metadata in jsp       This section illustrates you how to get column names... an example that retrieves all column names from a database table student1. Create
column matrix
column matrix  columan wise total matrix
column matrix
column matrix  columan wise total matrix
Shorting Table View By Column Name
Shorting Table View By Column Name This tutorial explains how to shorting table view by column name from the database in JSP and Servlet. This example... shorting  table view by column name. The code of "userdetails.jsp
Finding MAX value from emp_id column using SQL query?
Finding MAX value from emp_id column using SQL query?  I need to select maximum of the Emp_id values from SQL server 2005 table.I was using... query used:- select MAX(emp_id) from table_name
Display Sum of Table Column Using In JSP
Display Sum of Table Column Using In JSP... an application to Display the sum data of a Table column for a specific Date. We...=button value="Select Date" onclick="displayDatePicker('date
How to insert and update all column values of database from jtable.
How to insert and update all column values of database from jtable.  Hello Sir, I have developed a swing application in which database table...(); rs = stat.executeQuery("SELECT * from pandey"); deletedKeys
How to insert and update all column values of database from jtable.
How to insert and update all column values of database from jtable.  ...(); rs = stat.executeQuery("SELECT * from pandey... = new String[allRows.size()]; // Get column names and values
How to insert and update all column values of database from jtable.
How to insert and update all column values of database from jtable.  ...(); rs = stat.executeQuery("SELECT * from pandey... = new String[allRows.size()]; // Get column names and values

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.