saving data

View Answers

October 30, 2008 at 5:16 PM

Hi friend,

I am sending you data store code into the database.

<html>
<head>
<title>Insert into database</title>
</head>

<body>

<table border="1" width="50%" bgcolor="lightgreen">
<tr>
<td width="100%">
<form method="POST" action="insertAction.jsp">

<h2 align="center">Insert Data page</h2>
<table border="1" width="100%">
<tr>
<td width="50%"><b>Course Name:</b></td>
<td width="50%"><input type="text" name="coursename" size="20"/> </td>
</tr>
<tr>
<td width="50%"><b>Courese Fee:</b></td>
<td width="50%"><input type="text" name="couresefee" size="20"/> </td>
</tr>
<tr>
<td width="50%"><b>Faculty Name:</b></td>
<td width="50%"><input type="text" name="facultyname" size="50"/> </td>
</tr>

</table>
<p><input type="submit" value="Submit" name="submit">
<input type="reset" value="Reset" name="reset"></p>

</form>
</td>
</tr>
</table>

</body>

</html>
---------------------------


<%@ page language="java" import="java.sql.*" %>

<%
Connection con = null;
String url = "jdbc:mysql://localhost:3306/";;
String db = "amar";
String driver = "com.mysql.jdbc.Driver";
String userName ="root" ;
String password="root";
try{
Class.forName(driver);
con = DriverManager.getConnection(url+db,userName,password);
try{
Statement st = con.createStatement();
String empname=request.getParameter("coursename");
String position=request.getParameter("couresefee");
String facultyname = request.getParameter("facultyname");

int val = st.executeUpdate("insert student values(id,'"+empname+"','"+position+"','"+facultyname+"')");

con.close();

out.println("successfully insert data into database!");

}
catch (SQLException ex){
System.out.println("SQL statement is not executed!");
}
}
catch (Exception e){
e.printStackTrace();
}

%>

-------------------------------------

Please visit for more information.

http://www.roseindia.net/jsp/implement-javascript-with-jsp.shtml

Thanks.









Related Tutorials/Questions & Answers:
saving data in xml
saving data in xml  Hi, I have an xml file with spring map, in that i have parent child nodes. I have jsp form in that i have put same parent child elements. when i submit jsp form I want to append same data into xml file
Saving data in database
Saving data in database  hello i m facing a strange problem if i am submitting data form database then i can see it in database but if am submitting from app then it is not showing in to database but when i fetching form
Advertisements
saving data - JSP-Interview Questions
saving data  Dear Sir/Madam, Please teach me step by step how to save the data in JSP and using crimson editor? Thank u very much. rodmel  Hi friend, I am sending you data store code into the database
saving files
saving files  i want to create a program that would allows me to save my file and attach data
File saving and Writing
File saving and Writing   Hello Rose india..... I have a doubt for you plzzz kindly Help me... I have an "Arraylist" which includes some table... a "file create option" it will be ".csv" file and i want to write the data from
preview and saving an application form
preview and saving an application form   i have developed an application form, which is to be filled by the user.That application form is big in size so i have splitted that application form in 6 different forms ie, in first jsp
preview and saving an application form
preview and saving an application form   i have developed an application form, which is to be filled by the user.That application form is big in size so i have splitted that application form in 6 different forms ie, in first jsp
saving the changes in Microsoft sql sever - SQL
saving the changes in Microsoft sql sever  How do we commit the changes in Microsoft sql server
Saving URL in local disk - Java Beginners
Saving URL in local disk  Hi Friend, How can i Save URL like "www.jagran.com " on local disk throgh java Statement. Thanks ,in advance
saving form bean with Array of objects (collection) - Struts
saving form bean with Array of objects (collection)  Hi all... and captures data with checkbox. DisplayAction.java class populate my form bean... page. This page not only displays the Order's but also captures data from user
Saving image and text in mysql db using spring?
Saving image and text in mysql db using spring?  Hii, My requirement is to save the employee details(including image) into mysql db.i want to save the image location in db .And actual image(binary formate) should save
storing images in directory,saving path in db2
storing images in directory,saving path in db2  i am working in a web portal that makes a simple networking site. i want to store the profiles images in a folder and its path(relative/absolute) in my DB2 database. and when
Error in laodin and saving the image . - Swing AWT
Error in laodin and saving the image .  I am a student who had to submit their projects......so i am working on the Photo Editor Project. But i am facing problem while laoding and saving the image with help of JFileChooser class
Java code for Saving Marathi (Indian local language ) in Mysql and retrieving the same
Java code for Saving Marathi (Indian local language ) in Mysql and retrieving... going to save the marathi data into mysql and trying to retrieving the same from java using eclipse but after saving it shows " ???? " in place of marathi words
java image loadin and saving problem - Swing AWT
java image loadin and saving problem  hey in this code i am trying to load a picture and save it.........but image is only visible whn we maximize the frame savin is nt done plzz help me with this code......... import
how to upload multiple files in jsp and saving the path in database and the file in folder
how to upload multiple files in jsp and saving the path in database and the file in folder  how to upload multiple files in jsp and saving the path in database and the file in folder I have created a form for the upload of files
How to add save as dialoguebox to export into excel instead of directly saving..
How to add save as dialoguebox to export into excel instead of directly saving..  Hello Sir, i followed ur tutorial to export into excel from database and generated excel file at particular directory of my system
data
data  Handling data
data
data  data Handling AOP
data
data  Handling data in AOP
data
data handling examples in AOP Model  data handling examples in AOP Model
Develop user registration form
page and saving the data into the database. To store the data in the database... registration form which will insert  the entered  data into the database successfully with the help of a servlet. When submit button is clicked the data
Servlet question of saving song from database to user's hard disk. - JSP-Servlet
Servlet question of saving song from database to user's hard disk.  I have a form with a list box containing list of songs i.e list of mp3 files.There is also a "Download" button in the form. When I click on that button a servlet
What is big data science?
1000s of commodity servers for saving and analyzing the data. You can check...What is big data science?  Hi, What is big data science? What are the technologies to learn in Big Data? Thanks   Hi, Big Data science
Struts validation for j-query tabs data
Struts validation for j-query tabs data  Hi, I want apply struts validation for J-query tabs data while saving into database, can any body tell please
Java file
Java file       Saving and loading data to the file is one of the important feature of many applications which requires the programmer to learn how to read from and write
importing data and edit that data
importing data and edit that data   hello sir i have data in excel sheet which contain 2 rows and i want to import that data to ms access and edit that data like adding new columns and new rows and creating new tables
big data data science
big data data science  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: big data data... the topic "big data data science". Also tell me which is the good
data science and data mining
data science and data mining  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: data science and data mining Try to provide me good examples or tutorials links so that I
data mining data science
data mining data science  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: data mining data science Try to provide me good examples or tutorials links so that I can
big data and data science
big data and data science  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: big data and data science Try to provide me good examples or tutorials links so that I can
data science and data analytics
data science and data analytics  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: data science and data analytics Try to provide me good examples or tutorials links so
data science data analytics
data science data analytics  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: data science data analytics Try to provide me good examples or tutorials links so that I
data visualization in data science
data visualization in data science  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: data visualization in data science Try to provide me good examples or tutorials
User Registration Action Class and DAO code
(saving data into database). Developing Action ClassADS_TO_REPLACE_1 The Action...;data   if (objForm.getActionUpdateData().equals("update"...());   //Add the data   springHibernateDAO.addUser
What is Big Data and Data mining
What is Big Data and Data mining  Hi, Big Data, Data Mining and Data analytics are hot topic these days. What is Big Data and Data mining? Thanks
What is Big Data and Data mining
What is Big Data and Data mining  Hi, Big Data, Data Mining and Data analytics are hot topic these days. What is Big Data and Data mining? Thanks
data processing is
data processing is   data processing is   Data processing is associated with commercial work. Data processing is also referred as Information System. Data processing is basically used for analyzing, processing
data tyape
data tyape   please give me data type of Date
data tyape
data tyape   please give me data type of Date
data tyape
data type of Date  please give me data type of Date
data tyape
data tyape   please give me data type of Date
What is data analysis, and how does it work?
for collecting, cleansing, processing, saving it and analyzing data using various...What is data analysis, and how does it work?  Hi, I want to make career in Big Data and want to learn it. What is data analysis, and how does
Java Glossary Term - F
; Java File Saving and loading data to the file is one... methods, final classes, final data members, final local variables and final... of data, to encapsulate access to the data, to discover the functional operations
insert data
insert data  i've got a problem to insert my data to database.i can... and as well as the passed data from mulitpart/form-data is greater than or equal to 0...(request.getInputStream()); //we are taking the length of Content type data int formDataLength
data type
data type  which data type is used to store video file in mysql databse
data tyape
data type of date in mysql  please give me data type of Date
data tyape
What data tyape a date field req in SQL   please give me data type of Date
Real Life Uses of Data Science
for cost saving and building the brand image as an environment friendly one. Data...Data Science Tutorial - Real Life Uses of Data Science While the overwhelming growth of digital data is crossing all limits, putting the data into the right