JSP Store Results in Integer Format

JSP Store Results in Integer Format

JSP Example Code that stores the result in integer format in JSP

View Answers

April 2, 2008 at 8:18 PM

Hi! Just run the given JSP Example Code that stores the result in integer format in JSP

Name file as: retriveIntegerVal.jsp

<%@ page language="java" import="java.sql.*,java.util.*,java.text.*" %>
<html>
<head>
<title>Retrive value from database</title>
</head>
<body>
<table border="0" width="50%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%">
<h2><font color="#FF0033">Retrive data from database</font></h2>
<form method="POST" >
<table border="1" width="50%" cellspacing="0" cellpadding="0" bgcolor="#66FFCC">
<tr>
<td width="50%" valign="right"><b>First Name:</b></td>
<%
Connection con = null;
String url = "jdbc:mysql://localhost:3306/";;
String db = "register";
String driver = "com.mysql.jdbc.Driver";
try{
Class.forName(driver);
con = DriverManager.getConnection(url+db,"root","root");
try{
Statement st = con.createStatement();
String query = "SELECT * FROM retrivedata where id='2'";
ResultSet rs = st.executeQuery(query);
while (rs.next()) {
%>
<td width="50%" valign="right"><%=rs.getString("username")%><br/></td>
<tr>
<td width="50%" valign="right"><b>Position:</b></td>
<td width="50%" valign="right"><%=rs.getString("position")%><br/></td>
</tr>
<%}
rs.close();
con.close();
}
catch (SQLException ex){
System.out.println("SQL statement is not executed!");
}
}
catch (Exception e){
e.printStackTrace();
}
%>
</tr>

April 2, 2008 at 8:18 PM

</table>
</form>
</td>
</tr>
</table>
</body>
</html>









Related Tutorials/Questions & Answers:
display results on same jsp page
display results on same jsp page  is there any method to display search results from database on the same jsp page where i give the inputs using struts 1.2
display results on same jsp page
display results on same jsp page  is there any method to display search results from database on the same jsp page where i give the inputs using struts 1.2
Advertisements
display results on same jsp page
display results on same jsp page  is there any method to display search results from database on the same jsp page where i give the inputs using struts 1.2
To store date - JSP-Servlet
To store date  Hai friends, I want the format to store date in database MySQL. But, date object returns day, month, and year in integer format only. If it is possible to convert from integer to date send me
How to store two integer value in a separate file and retrieve those values
How to store two integer value in a separate file and retrieve those values  I need to save two values so i can use those values later i came up.... But Don't have any idea how can i do that. Like what format of file i need, or how
pdf format - JSP-Servlet
pdf format  hi Sir, how to convert text format into PDF format. thanks & regards, vijayababu.m
Jsp Code to store date in database - JSP-Servlet
Jsp Code to store date in database   Hi, Can u give me jsp code to store current date in to database. Thanks Prakash
dbase store - JSP-Servlet
dbase store  HI! In my project i have to store phone number in dbase. i used numeric (11,0) as data type for phone number. When i am trying to store the phone number, It is show showing error for Input String "given phone number
how to add Arraylist filter for a jsp page showing results from a servlet
how to add Arraylist filter for a jsp page showing results from a servlet  hello sir/mam, in my project i have an arraylist showing results in a jsp... and remove other results how to do that?   Hi Friend,ADS
To save table format data in pdf/excel in jsp
To save table format data in pdf/excel in jsp  Hello, I am doing web application project in jsp. In webform ,I am displaying database data in html table. So my question is ,I want so save this html format data in pdf/excel format
project in JSP and XML(to store data)
project in JSP and XML(to store data)  I need to complete an assignment in JSP and using XML as Database ,Please help me to complete... of JSP Web Application demonstrating web technology concepts? Create n
Display Records in Tree Format - JSP-Servlet
Display Records in Tree Format   hi i want to displays data in the tree format with root nodes, child nodes and leaf nodes in a jsp file... we have to pass values of root node subnodes and the leaf node to next jsp
JSP Excel report download for .xlsx format
JSP Excel report download for .xlsx format  <%@ page contentType...; The above code works fine because i am trying to save/open excel file in .xls format but my requirement is to download excel with format .xlsx (m.S 2007),so i changed
JSP and XML .data store nd retrieve
JSP and XML .data store nd retrieve  I have made a form in jsp having emp id, projectname and emp name.I want to store data related to employee in xml file.How can i store data entered by user in XML file and later retrieve data
How to store and retrieve image from database in JSP?
How to store and retrieve image from database in JSP?  Hi, In one of my application I have to store and then display the image in JSP. How to store and retrieve image from database in JSP? Thanks   HI, You can use
How to store values in a database using JSTL? - JSP-Servlet
How to store values in a database using JSTL?  I want to store values in a database... How can i store in database? Here is my code... This wil extract details and displays in a table format... Now i want to store these values
how to store data in XML file - JSP-Servlet
how to store data in XML file  hi i have to store the data for example user id and password in a xml file the input userid and password will be coming from jsp middle ware servlet how to do that?   Hi friend
store
store  i want to store data in (.dat) file format using swing and perform operation on that insertion,deletion and update
dynamic retrivel of data from mysql database in table format at jsp
the data from database and display it as table format in jsp... For example, i have... and also details of each member should be displayed in the table format in jsp...dynamic retrivel of data from mysql database in table format at jsp  
access image from ajax store in mysql using jsp
access image from ajax store in mysql using jsp  access image from ajax store in mysql using jsp (code to access image captured by camera and store in mysql
program to enter values from one jsp page and then do calculation on some formula and that results is displayed in another jsp
program to enter values from one jsp page and then do calculation on some formula and that results is displayed in another jsp  <%@ page language="java" import="java.util.*;"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
Extract xml to store into db - JSP-Servlet
Extract xml to store into db  Hi all, I need to get the data from the xml file and store it onto the database. Is there anyway of doing this? thanks
for store data in data base - JSP-Servlet
for store data in data base  i want to a job site, in this site user..... and on 3rd form i use submit button... data of form 1 and 2 can also be store... Friend, We have created 4 jsp files: 1)login.jsp: A:hover
displaying List of records from database in a jsp using ajax, onclick it should display the results ?? its urgent can u help me
displaying List of records from database in a jsp using ajax, onclick it should display the results ?? its urgent can u help me   displaying List of records from database in a jsp using ajax, onclick it should display the results
Produces XML file but format not correct for storing data using JSP and XML
Produces XML file but format not correct for storing data using JSP and XML  hii I have created a project using JSP and XML as database to store data... XML file also(wrong format),shows result in JSP page but server shows
how to store a dynamic values - JSP-Servlet
how to store a dynamic values  Dear sir, i have a ArrayList in that i have stored a values from a excel sheet specified column values and i have one string that is as follows Dear ~2 , Your cl is ~3 ,el is ~4
how to store data in other table using servlet and jsp
how to store data in other table using servlet and jsp  pls can anyone tell how to store data in other table using servlet and jsp and want to display that data too.and the data in first table must be same.pls help
send multiple textbox vaues in to an jsp form to store them in a DB table
send multiple textbox vaues in to an jsp form to store them in a DB table  Hi sir... I am not getting how can i send the multiple input text box values in to an jsp file with additional values to store those values
Results
Results After action executes business logic, <result > tag is used to display the View. Struts2 provides or supports to 11 types of Results:ADS... is specified, default type "dispatcher" is used to dispatch to JSP pages.ADS
How I Upload File and Store that file name in Database using JSP
How I Upload File and Store that file name in Database using JSP  Hi All, I m the beginner in JSP and I want to upload the file and store that file and some other form data in MySQL database. Ex. There is one employee detail
how to append data to XML file in proper format using JSP
how to append data to XML file in proper format using JSP  hello i was appending my XML file to add more data entered by user in JSP page.But not getting XML file in proper format as XML rules.lease help me to get XML file
HOW TO STORE MULTIPLE EMPLOYEE DETAILS TO XML FILE USING JSP?
HOW TO STORE MULTIPLE EMPLOYEE DETAILS TO XML FILE USING JSP?  HELLO SIR, CAN ANYONE HELP ME OUT HOW TO STORE MULTIPLE EMPLOYEE DETAILS TO XML FILES,IF I ENTER 4 EMPLOYEE DETAILS(NAME,ID,SALARY,EMAIL) ALL THE DETAILS OF 4
date format - JSP-Servlet
store input and display previous input as well current input. in jsp
store input and display previous input as well current input. in jsp  Hi Friend, In this JSP program i want display the previous input as well... am trying to take new input it replaces old one. i want to store and display
how to store the data in a array retrived from the database - JSP-Servlet
how to store the data in a array retrived from the database  hi... in database,and i need to disply all the employees record in a single jsp. pls can any one tell me how to do it this using jsp. thankyou,  Hi nagaraj
swap two integer arrays
swap two integer arrays  int [] array1 = {1,2,3,4,5} int [] array2 = {6,7,8,9,10} how can we swap the values of bith integer arrays results like this array1 = {6,7,8,9,10} array2 = {1,2,3,4,5
swap two integer arrays
swap two integer arrays  int [] array1 = {1,2,3,4,5} int [] array2 = {6,7,8,9,10} how can we swap the values of bith integer arrays results like this array1 = {6,7,8,9,10} array2 = {1,2,3,4,5
swap two integer arrays
swap two integer arrays  int [] array1 = {1,2,3,4,5} int [] array2 = {6,7,8,9,10} how can we swap the values of bith integer arrays results like this array1 = {6,7,8,9,10} array2 = {1,2,3,4,5
How to store data entered by User in JSP page in XML file
How to store data entered by User in JSP page in XML file  How to store data entered by user in JSP page to be saved in XML file.On clicking submit...   JSP store data entered by user into XML file 1)form.jsp: <html>
How to download files from server to local disk using ZIP format in JSP page - JSP-Servlet
How to download files from server to local disk using ZIP format in JSP page  hi i have an application to upload and download multiple files. As i... disk creting ZIP format for all files .how can create ZIp for all files pls help me
store
store  hi i want store some information in my program and use them in other method. what shoud i do
how to store image in folder and stored image path in mysql database using JSP
how to store image in folder and stored image path in mysql database using JSP  how to store image in folder and stored image path in mysql database using JSP
How to store user name,city,state,image path into database and image into folder using jsp
How to store user name,city,state,image path into database and image into folder using jsp  How to store user name,city,state,image path into database and image into folder using jsp
How to store multiple images in folder and images path in database at a time using jsp?
How to store multiple images in folder and images path in database at a time using jsp?  I wanna browse multiple images in one form and store them in one folder and their path into datrabase
How to store data entered in JSP page by a user in XML file & later retrieval of data using id at other page
How to store data entered in JSP page by a user in XML file & later retrieval of data using id at other page  I have made a form in JSP having emp id, projectname and emp name.I want to store data related to employee in xml
JSP - JDBC
JSP Store Results in Integer Format  JSP Example Code that stores the result in integer format in JSP  Hi! Just run the given JSP Example Code that stores the result in integer format in JSPName file
STRUTS-display search results - Struts
STRUTS-display search results  Hii, I am a beginner in struts..I want to retrieve few records from database and display in jsp page.First i tried... them in jsp.. Search Results
integer to string
integer to string  i have to develop a program which convert integer into character from 1 to 10,000 if we input 1 then it give output 'one' n so on till 'ten thousand' kindly give me the codes plzplz sir........   Have
Integer exception in java
want to store an integer in a hash table, you have to "wrap" an Integer... Integer exception in java       The integer class is a wrapper for integer value
How to get the text from textarea in HTML and store it in database using javascript and jsp
How to get the text from textarea in HTML and store it in database using javascript and jsp  How to get the text from textarea in HTML and store it in database using javascript and jsp <script> function str() { <

Ads