Home Answers Viewqa JSP-Servlet problem in inserting data in databases created in netbeans using jsp..

 
 


sheetal
problem in inserting data in databases created in netbeans using jsp..
0 Answer(s)      11 months ago
Posted in : JSP-Servlet

i am trying to make a virtual classroom website in jsp using netbeans.i created table inside netbeans through sql editor.and tried to make a login page whose details are saved into that database.used ur code 1)register.jsp:

<html>
<form method="post" action="insert.jsp">
<table>
<tr><td>First Name:</td><td><input type="text" name="fname"></td></tr>
<tr><td>Last Name:</td><td><input type="text" name="lname"></td></tr>
<tr><td>Email:</td><td><input type="text" name="email"></td></tr>
<tr><td>Password:</td><td><input type="password" name="pass"></td></tr>
<tr><td>Confirm Password:</td><td><input type="password" name="cpass"></td></tr>
<tr><td>Date Of Birth</td><td><input type="text" name="dob"></td></tr>
<tr><td>Age:</td><td><input type="text" name="age"></td></tr>
<tr><td>Gender</td><td><input type="text" name="gender"></td></tr>
<tr><td>Address:</td><td><input type="text" name="address"></td></tr>
<tr><td>Country</td><td><input type="text" name="country"></td></tr>
<tr><td>State:</td><td><input type="text" name="state"></td></tr>
<tr><td>City</td><td><input type="text" name="city"></td></tr>
<tr><td>Telephone No:</td><td><input type="text" name="tno"></td></tr>
<tr><td>Mobile:</td><td><input type="text" name="mobile"></td></tr>
<tr><td></td><td><input type="submit" value="Submit"></td></tr>
</table>
</form>
</html>

2)insert.jsp:

<%@page import="java.sql.*,java.util.*"%>
<%
String fname=request.getParameter("fname");
String lname=request.getParameter("lname");
String email=request.getParameter("email");
String pass=request.getParameter("pass");
String cpass=request.getParameter("cpass");
String dob=request.getParameter("dob");
int age=Integer.parseInt(request.getParameter("age"));
String gender=request.getParameter("gender");
String address=request.getParameter("address");
String country=request.getParameter("country");
String state=request.getParameter("state");
String city=request.getParameter("city");
int telephone=Integer.parseInt(request.getParameter("tno"));
int mobile=Integer.parseInt(request.getParameter("mobile"));
        try{
         Class.forName("com.mysql.jdbc.Driver");
           Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/roseindia", "root", "root");
           Statement st=con.createStatement();
           int i=st.executeUpdate("insert into student(firstname,lastname,email,pass,confirm_pass,dob,age,gender,address,country,state,city,telephone,mobile) values('"+fname+"','"+lname+"','"+email+"','"+pass+"','"+cpass+"','"+dob+"',"+age+",'"+gender+"','"+address+"','"+country+"','"+state+"','"+city+"',"+telephone+","+mobile+")");
        out.println("Data is successfully inserted!");
        }
        catch(Exception e){
        System.out.print(e);
        e.printStackTrace();
        }
        %>

everything goes fine but the values are not updated in the table. what to do? plz help?

View Answers









Related Pages:
problem in inserting data in databases created in netbeans using jsp..
problem in inserting data in databases created in netbeans using jsp..  i am trying to make a virtual classroom website in jsp using netbeans.i created table inside netbeans through sql editor.and tried to make a login page whose
Problem in inserting clob data in jsp
Problem in inserting clob data in jsp  how to insert any rich text editor data (which have more than 32766 characters) in a clob type column of oracle database with jsp
Inserting data on a database in servlet - JSP-Servlet
Inserting data on a database in servlet  Hi I am following... to a databse by a servlet.I used the example in "Inserting Data In Database table... of a table,that is none of the data which i tried to enter into database by using
problem on jsp, inserting data into table(mysql).
problem on jsp, inserting data into table(mysql).  hello friends, I have a problem in jsp.I want to insert data, which is given by user through... is in mysql.I want to use placeholder("?") to insert data into table.Plsssss help
need help....how to connect and disconnect multiple databases(databases created in mysql) using java and my sql
need help....how to connect and disconnect multiple databases(databases created in mysql) using java and my sql  i am working on a project... to know that how to query multiple databases(databases created in my mysql) so
conflicting databases
for jsp project in netbeans. now mysql in xampp showing this result. 1:10:05 PM... [mysql] Problem detected! 1:10:05 PM [mysql] Port 3306 in use
conflicting databases
for jsp project in netbeans. now mysql in xampp showing this result. 1:10:05 PM... [mysql] Problem detected! 1:10:05 PM [mysql] Port 3306 in use
hibernate firstExample not inserting data - Hibernate
problem is data is not inserting into DB even though the program is executed... DEFAULT CHARSET=latin1 data is not inserting...hibernate firstExample not inserting data  hello all , i followed
inserting value - JSP-Servlet
;Inserting form data into database using JSP and ServletGiven code will illustrate you, how one can get data into database using JSP and ServletExample Code... that will insert the HTML form data into database using JSP and Servlet
To create an web application using netbeans IDE
To create an web application using netbeans IDE  Hi, I'm a beginner in java and I have created an jsp code for entering the username password... to write a java code for inserting my values in to the database... Thank you
JSTL in Netbeans 6.9.1
JSTL in Netbeans 6.9.1  I am seeking your help in solving problem I am facing. The problem has been described below: I am using JSTL1.1 core tag... used c:set, c:forEach, c:if, c:out tags as part of my jsp to dsplay data
connecting databases
application is created in netbeans
Databases
Databases  how to add data dynamically into the database table?? i used back end is mysql....   1)form.jsp: <html> <form method...('"+name+"','"+address+"',"+contact+",'"+email+"')"); out.println("Data
problem in jsp using ms-access
problem in jsp using ms-access  after starting server(tomcat) wen v...)Your DSN will get created. 6) Restart your server and run your jsp code. Here... will get created. 6) Restart your server and run your jsp code. Here is your
Inserting Data into mysql - SQL
Inserting Data into mysql  My sincere apologize for this post. I noticed there is no category for php. However am hoping my question will fit... (using php)and inserting the details in a mysql database. Lets take for instance
Problem in enctype="multipart/form-data" in JSP
Problem in enctype="multipart/form-data" in JSP  im using a page which is in JSP. i have some text boxes and one upload button. i want to load the file itself when i click the submit button. im using enctype="multipart/form-data
inserting data from radio buttons to database-ERROR - JSP-Servlet
inserting data from radio buttons to database-ERROR  hi, i have... for this problem. thanks and regards nishi kishore  Hi Friend, The whole problem is because of 'option' field in database.It seems that 'option
inserting data from radio buttons to database - JSP-Servlet
inserting data from radio buttons to database  hi, i am getting error in my code of feedback form. once i finished selecting all the radio buttons...'' at line 1 please provide me the solution of this problem. thanks
Inserting Image(s) - JSP-Servlet
Inserting Image(s)  Hello, I need sample code using java servlet...;); File file = new File("C:/apache-tomcat-5.5.23/webapps/jsp/red_rose2.gif...;body><h1>Database Connection Problem.</h1></body></html>
jdbc and swing problem in netbeans
jdbc and swing problem in netbeans  i reteived the table from database in a jdbc program. next i want to do is place the table as it is in a jpanel.. i am using netbeans IDE can u tel me how to do that one?? urgent
jdbc and swing problem in netbeans
jdbc and swing problem in netbeans  i reteived the table from database in a jdbc program. next i want to do is place the table as it is in a jpanel.. i am using netbeans IDE can u tel me how to do that one?? urgent
inserting data from radio buttons to database - JSP-Servlet
inserting data from radio buttons to database  hi, my problem is as follows: i am creating a feedback form of a college. this feedback form... need a solution of this problem thanks and regards Nishi Kishore  
How to Make a Pdf and inserting data
How to Make a Pdf and inserting data   ... a pdf file and how we can insert a data into the pdf file. This all be done by using the jsp.  To make this program firstly we need to import java.io.* package
jsp using netbeans
jsp using netbeans  Code to access and manage multiple e-mail accounts on the same page.. user should be able to edit mail accounts' link as required
NetBeans IDE
Java NotesNetBeans IDE Sections: Introduction to NetBeans Downloading NetBeans Where to find tutorials and documentation Starting a new project in NetBeans Starting a new GUI project (covered in the www.netbeans.org tutorial) Misc
help me in inserting data into db using hibernate
help me in inserting data into db using hibernate  How to insert data into dependent tables through hybernate   Hi Friend, Please visit the following link: http://www.roseindia.net/hibernate/insert-data-database.shtml
oracle connectivity problem with netbeans
oracle connectivity problem with netbeans  sir I am using oracle window version +net bean6.8. jam trying to connect net bean to oracle. for this after adding new driver(ojdbc6.jar) in services tab I got connectivity with oracle
jsp directory created in net beans but not able to access
jsp directory created in net beans but not able to access  File f... trying to display image i am not able to display i am using netbeans and using...("/") + "artists/" +username + "/images"); images.mkdir(); i am using this code
How to insert data into databse by JSP form registration page in netbeans
of data for login purpose. I have created 1 form in JSP netbeans with both username...How to insert data into databse by JSP form registration page in netbeans   Hello everyone, i am new comer to web development & netbeans, i m
how to load flash file in any browser through jsp using NetBeans IDE without embed tag
how to load flash file in any browser through jsp using NetBeans IDE without... using jsps.But it's not loading. I used tag like this <object id="flowplayer" width="300" height="200" data="http://releases.flowplayer.org/swf
codes for banking databases
codes for banking databases  sir plz give me codes for creating a banking database using netbeans as back end and java as front end
Problem insert data into database using servlet n javabean - Java Beginners
Problem insert data into database using servlet n javabean  I created a servlet for registration proses I got a problem compiling my servlet... to solve it.. i really new in jsp+servlet+javabean,dont really unnderstand 1)my
jsp problem
jsp problem  Hi every one plz give me answer for below question ASAP I created one JSP(used pre defined javascript in jsp to get rtf format in browser) which creats RTF Format in browser to enter data. MY question is after i
coding problem in netbeans - Java Beginners
coding problem in netbeans  hi, i have just started programming in netbeans,i'm facing a problem in a java application i create a jframe class and jbutton and jtextfeild inside it now i have created another class c1
jsp problem
jsp problem  problem:::::::: On JSP form ,when i insert data in text field........at that time action is perform and data is retriev from data base and get assign to other field on that form........ when data is assign to other
Inserting data in Excel File - Java Beginners
Inserting data in Excel File  Dear Sir, How can we fill the excel with fetched data from the database like Oracle, DB2? Is it possible to create an excel with filled data? Kindly give me the solutions to questions
webservice in Netbeans
.. im using netbeans version 6.9.1 .. pls help me out... regards-- Harish Kumar... problem at 17 th step while right clicking on the source code im not getting
data (image ,audio) inserting to data base (oracle 10g) and retriving the same data from jsp
data (image ,audio) inserting to data base (oracle 10g) and retriving the same data from jsp   data (image ,audio) inserting to data base (oracle 10g) and retriving the same data from jsp with script of data base plz help me
Biological Databases Links
in bioinformatics. The Institute manages databases of biological data including... Biological Databases       Biological Databases are like any other databases
JSP Problem - JSP-Servlet
JSP Problem  Hi, I have problem,this is my senario I have one jsp,this jsp having the 3 fields.let me take 3fields userName,emailAddress... by using the "AddUser" button.when ever i click on "Submit" button the data should go
Creating Login Page In JSF using NetBeans
illustrates you how to create a login form in JSF using NetBeans. To create the jsp page in NetBeans: 1. Right click on Web Pages under your project. 2. Go to New- JSP... Creating Login Page In JSF using NetBeans  
Problem in accessing data from Database
Problem in accessing data from Database  hi..... i'm making a project on servlet and jsp with ms access 2007 at the backend. One field in my database... in currency column and then try to retrieve data using my servlet coding
java -netbeans help - Java Beginners
java -netbeans help   a simple program in netbeans ide to add two... in textarea that is created in input.java file   Hi Friend, Try.../mam, i developed frontend with netbeans with buttons and textarea.. am executing
Problem in enctype=
Problem in enctype=  im using a page which is in JSP. i have some... the submit button. im using enctype="multipart/form-data" in this form. i also using.... but the problem is the uploaded file is not stored in the prefered folder. i printed
inserting image in mysql database using browse button in servlets
inserting image in mysql database using browse button in servlets  Hi,I want to insert a image in mysql database using browse button. and, i want.... could you plz help me.   Hi Friend, We have created an application
Lock while inserting/updating database in multithreaded.
Lock while inserting/updating database in multithreaded.  Hi, I am having a multithreaded process which replicates the data from many table to one... back the connection to connection pool for re-use. My problem is, from past
How to get the data from the database using Servlet or JSP program
How to get the data from the database using Servlet or JSP program  .... Actual problem is that i have a simple program in jsp in the sense to get data... the problem   Get data from database using servlet Retrieve data from
uploading problem
uploading problem  i use glassfish server.. using netbeans for jsp... i wnat to upload a file to a folder 'doc' and insert corresponding data...(); } } } } %> my problem...: firstly
inserting into mysql database with uid to be primary key and autoincrement
inserting into mysql database with uid to be primary key and autoincrement  hello, i am new to jsp and facing problem in creating a database entry...; Here is the code of inserting values from jsp form to database
Deploy netbeans project on external tomcat server - Framework
Deploy netbeans project on external tomcat server  Hello i have created an application using netbeans 5.5............i want to know that how i can run this project on external server. let me clarify: netbeans 5.5 has

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.