Home Answers Viewqa JDBC JSP Store Results in Integer Format

 
 


Riya
JSP Store Results in Integer Format
2 Answer(s)      5 years and 2 months ago
Posted in : JDBC

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 Pages:
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
store
store  i want to store data in (.dat) file format using swing and perform operation on that insertion,deletion and update
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
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
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
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
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
Java File Handling Test Results
Java File Handling Test Results   Is somebody able to help me with this Write a program to read each name from the file and prompt the user... output: "); String f = scan.nextLine(); String format = f.toUpperCase
pdf format - JSP-Servlet
pdf format  hi Sir, how to convert text format into PDF format. thanks & regards, vijayababu.m
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
Java Integer class
or integer value in String format. Converting primitive types into the corresponding... Java Integer class      ... as objects offers utility methods to manipulate the values. For example, Integer class
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 write quesry results into spread sheet
how to write quesry results into spread sheet   Hello sir/madam, I need a solution/code for the below scenario. In jsp, based on the date range... and pop up the spread sheet in the jsp to save option. thanks   more
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
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
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, Please
Convert an Integer into a String
an integer number at  the console and it converts it into a string format... Convert an Integer into a String       In this section, you will learn to convert an integer
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
Convert Integer to Float
is converted into a float format. toString():  This method converts an integer... Convert Integer to Float       In this section, you will learn to convert an integer type data
Convert a String into an Integer Data
number into an integer format. Whenever you give the string type data as 's... Convert a String into an Integer Data   ... type data into an integer type. The java.lang package provides
image store and get it back
store the image in table but at time of reading it back it never shows me the image and how to convert the image file into binary format.... so that i can store...image store and get it back  store the image in the oracle using blob
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
date format - Date Calendar
date format  how to convert dd-mmm-yyyy date format to gregorian calendar format in JSP please tell me the code  Hi friend, Code...="19-Sep-2008"; DateFormat format ; Date date ; format = new
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
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
To store value in session & display it
To store value in session & display it  Hello..I m trying to run the following code which will store the session of a book selected on click... Help me in this.. This is the JSP Page <html> <head>
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
Date auto format
Date auto format  Hi, I have jsp page and Date field with input type. Requirement is, if we enter date as MMDDYY or MMDDYYYY and clicking the tab the date(MMDDYY or MMDDYYYY) have to auto format to MM/DD/YYYY. could you please
store
store  hi i want store some information in my program and use them in other method. what shoud i do
Displaying search results in same panel of gridview in same jframe window.
Displaying search results in same panel of gridview in same jframe window... search and see the results in the same panel of the Jframe in Gridview Jtable format ... Jtable is being constructed dynamically based on columns of database
Displaying search results in same panel of gridview in same jframe window.
Displaying search results in same panel of gridview in same jframe window... search and see the results in the same panel of the Jframe in Gridview Jtable format ... Jtable is being constructed dynamically based on columns of database
how to print pdf format
/attendence in pdf format. please help me. thanks in advance.   Here is a code that will store the database data into pdf table. We have used itext api
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
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
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
Integer Auto incremented ID not showing up
Integer Auto incremented ID not showing up  SearchStudent.jsp Student to search into database <script language="javascript">... org.apache.jasper.JasperException: An exception occurred processing JSP page /FoundStudents.jsp at line 58
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
store data from a variable in mysql?
store data from a variable in mysql?  sir last time asked you tell me how to retrieve data from a database mysql and store it in an int variable in order to apply some calculation on it, but now i want to store the result
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
how to store and then immediately retrieve when store the image into database?
how to store and then immediately retrieve when store the image into database?  how to store and then immediately retrieve when store the image into database?   Here is a jsp code that insert and retrieve image from
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
store dropdown box values in database server
store dropdown box values in database server  how to store dropdown box values in database server in jsp
store pagination form fields - Struts
store pagination form fields   hi,iam working online exams project . my intention is to save data that has been asnwered by client/student into db... approach this task. iam using jstl in jsp to iterate the list object of different
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

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.