value is inserted into the sql table through jsp-jdbc but not getting stored into the data base,only row is increasing.

value is inserted into the sql table through jsp-jdbc but not getting stored into the data base,only row is increasing.

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>

        <style type="text/css">
<!--
.style1 {
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
    font-size: 18px;
}
-->
        </style>
</head>
    <body>
        <p>Â </p>
        <p>Â </p>
        <p>Â </p>
        <p>Â </p>
        <table width="498" height="177" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#666666">
          <tr>
            <td width="184" height="51"> <div align="center" class="style1">
              <div align="justify">NAME </div>
            </div></td>
            <td width="187"><label>
              <input  type="text" name="textfield" size="30">
            </label></td>
          </tr>
          <tr>
            <td height="48" class="style1"> <div align="justify">EMAIL</div></td>
            <td><input name="textfield2" type="text" size="30"></td>
          </tr>
          <tr>
            <td height="39"><div align="justify" class="style1">PASSWORD</div></td>
            <td><input name="textfield3" type="text" size="30"></td>
          </tr>
          <tr>
            <td height="39">Â </td>
            <td><input type="submit" name="Submit" value="Submit"></td>
          </tr>
    </table>
           <h1>Â </h1>


           <form action="http://localhost:8080/WebApplication1/faces/jsp1.jsp">
               <%@page language="java" %>
               <%@ page import ="java.sql.*"  %>

      <%     String  name=request.getParameter("textfield");
              String email=request.getParameter("textfield2");
              String password=request.getParameter("textfield3");  


          try{     

    //String query ="INSERT INTO demodb VALUES('"+name+"','"+email+"','"+password+"')";
    Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@Nayna-PC:1521:orcl","scott","tiger");
      //Statement stmt=conn.createStatement();
    PreparedStatement ps=conn.prepareStatement("insert into demodb(name,email,password) values(?,?,?)");
     ps.setString(1,name);
    ps.setString(2,email);
    ps.setString(3,password);
    int rs=ps.executeUpdate();
   //conn.close();
    if(rs!=0){
    System.out.println("successful");
    }
    else{
    System.out.println("unsuccessful");
    }
    }
          catch(Exception e){
              System.out.println("error in connection"+e);
          }

        %>

    </form>
</body>
</html>
View Answers









Related Tutorials/Questions & Answers:
value is inserted into the sql table through jsp-jdbc but not getting stored into the data base,only row is increasing.
value is inserted into the sql table through jsp-jdbc but not getting stored into the data base,only row is increasing.  <html> <..."> <title>JSP Page</title> <style type
Deleting a Row from SQL Table Using EJB
Deleting a Row from SQL Table Using EJB   ... to delete a row from the SQL Table. Find out the steps given below that describes how to delete a particular row from the database table using EJB. The steps
Advertisements
What?s the maximum size of a row in SQL table?
What?s the maximum size of a row in SQL table?  What?s the maximum size of a row in SQL table?   Hi, The maximum Row Size is 8060 Bytes in a sql table.ADS_TO_REPLACE_1 Thanks
Insert Data in Table Using Stored Procedure
Insert Data in Table Using Stored Procedure ... data into a table using stored procedure. Steps: 1.Create database... Your data has been inserted into table. Download the source code
the last data entered into database is getting stored again after refreshing
the last data entered into database is getting stored again after refreshing  hey all i made a shout box using php and mysql but the last data... if the data is deleted from the database the last data entered is getting posted plz help
Delete row and column from table through java code
Delete row and column from table through java code... will see how to delete row and column from given table through java code. Java code... | +----+----------+------------+---------+ In this table we will delete the row having minimum value of ID then delete
getting radio button at start of each row of table - Struts
getting radio button at start of each row of table  i have done the following things, and this is fine for me. But i want radio button at the place... at the start of each row as u saw in above output. So what should i have to do
how to select the row value that was retrived from the database ?
how to select the row value that was retrived from the database ?  I am getting the data's from the table that was stored in database. Now in the page in which i am getting all the data from the database has an another select
how to select the row value that was retrived from the database ?
how to select the row value that was retrived from the database ?  I am getting the data's from the table that was stored in database. Now in the page in which i am getting all the data from the database has an another select
Deleting a Row from SQL Table Using EJB
Deleting a Row from SQL Table Using EJB... are going to delete a row from the SQL Table. Find out the steps given below that describes how to delete a particular row from the database table using EJB
mysql table construction - SQL
mysql table construction  In MySql there is no pivot function. using a function or Stored Procedure, I want to loop through a column of data and create a another table that uses the row value as Column labels from the row
Sql row retrieve - SQL
Sql row retrieve  Sir What are the sql statements so that I can retrieve rows from a table by specifying the row numbers such as row no.5 to 10...; Sir What are the sql statements so that I can retrieve rows from a table
Convert the excel sheet data into oracle table through java or jsp
Convert the excel sheet data into oracle table through java or jsp  Hi Friends, Let me help this issue i am phasing Convert the excel sheet data into oracle table through java or jsp
how to display the selected row from the data table in model panel ??
how to display the selected row from the data table in model panel ?? ...:dataTable value="#{tableRecordBean.dataList}" var="dataItems" onRowClick="#{rich...="350"> <f:facet name="caption"> <h:outputText value
Getting the last inserted id using jsp
Getting the last inserted id using jsp  Pls how can i retrieve the last inserted id after submitting a form to mysql using jsp
SQL add column default value
a example from SQL add column default value .In this, we create a table Stu_Table... of 10,when no value is inserted into table during insert statement operation... SQL add column default value   
Why you are not getting value from your data science?
Why you are not getting value from your data science?  Hi, I am... for the tutorials to learn: Why you are not getting value from your data science? Try...;Why you are not getting value from your data science?". Also tell me which
how insert data from databse in array and compare new data to already stored value in array
how insert data from databse in array and compare new data to already stored value in array   hello all i tried to fetch data from databse and try to stored it in an array and i want to compare new value that come from database
same data inserted 2 times
same data inserted 2 times  thanks for reply, i know the insert command. but same data inserted 2 times.where is the problem i cannot understood
Hoe to refresh a table row dynamically
Hoe to refresh a table row dynamically  Want to refresh a table data... Friend, Is there a link attribute with every row of a table through which we will able to refresh a particular table row?ADS_TO_REPLACE_1 Please clarify
add image in a row of table
add image in a row of table  i have a table in which i have to add... a label in which instead of passing text i have inserted image using jLabel.setIcon(new ImageIcon("E:/2.jpg"));.But when i pass this jlabel in the row it shows
add image in a row of table
add image in a row of table  i have a table in which i have to add... a label in which instead of passing text i have inserted image using jLabel.setIcon(new ImageIcon("E:/2.jpg"));.But when i pass this jlabel in the row it shows
same data inserted 2 times in database
same data inserted 2 times in database  pls help me, i have table studentmaster(firstname,lastname,fathername,phone,address). i am inserting data into database 2 times the data will be inserted. forexample: firstname
how to retrieve data from table with runtime values in sql?
how to retrieve data from table with runtime values in sql?  how to retrieve data from table with runtime values in sql? For example, I have table... value. But I dont know how to retrieve the values whenever i pass different dates
upload the text file through html and insert those data into the table
upload the text file through html and insert those data into the table  i want to take input form a text file.there is a table in database oracle... into table.now i want to upload the text file through html and insert those data
use data from database table as hyperlink value - JSP-Servlet
use data from database table as hyperlink value  I'm creating a web... to hyperlink. I want to use this data as hyperlink and use it as the value... as the hyperlink's value then pass to the next page and retrieve the complete details of the row
SQL Out Parameter
SQL Out Parameter       SQL Out Parameter allows the stored procedure to the pass data.... The OUT parameter  allows the stored procedure to pass the value and pass back
Adding button to each row for the table and adding row to another table
Adding button to each row for the table and adding row to another table  Hi I need to add button to each line in the table(Table data is retrived... row of the table
Retriving data stored in database
Retriving data stored in database  Hi, How to retrive data from my sql database using Hibernate,Spring and tapestry please give me an example.I am new to this Hibernate and Spring
How to import data from sql server table into an excel file by creating the rows dynamically in the excel according to the dataabase??
How to import data from sql server table into an excel file by creating... data from sql server table into an excel file by creating the rows dynamically in the excel according to the dataabase?? There is a table in sql server having
Table maximum Row count - JDBC
Table maximum Row count  Dear friends I want to select maximum... maximum time entry value? Thanks in advance Rajkumar  Hi friend, Sql Query for select maximum value max() function use. "select max
use struts 1.0 to view sql table value on JSP page
use struts 1.0 to view sql table value on JSP page  Here i am using struts 1.0 to view my sql table values on jsp page. But the problem is when i append the value in bean then i find the last row of table is shown repetedly. Any
use struts 1.0 to view sql table value on JSP page
use struts 1.0 to view sql table value on JSP page  Here i am using struts 1.0 to view my sql table values on jsp page. But the problem is when i append the value in bean then i find the last row of table is shown repetedly. Any
Display error message if data is already inserted in database
Display error message if data is already inserted in database   Display error message if data is already inserted in database Pls help me Thanks
delete row from a table in hibernate
delete row from a table in hibernate  is there method to delete row in a table using hibernate like save(-) to insert row
Inserting Data In Database table using Statement
to insert the data in the database from our java program in the table stored... Inserting Data In Database table using Statement... of the PrintWriter class. We can insert the data in the database only and only
MySQL Append Data
;  This example illustrates how to append data with a column value. 'CONCAT()' function is used to append data to the column value...;studentid" column for each row of the "mca" table.ADS_TO_REPLACE_1 Table
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 connection interface and java driver. After it we can delete row using "delete
Getting mysql table in textbox
Getting mysql table in textbox  how to get mysql table values into textbox in java using ajax and servlets
JavaScript add row to table
JavaScript add row to table      ...' and 'td'. As you already know that 'td' contains the table data and 'tr 'defines...(document.createTextNode()) adds the text node to the 'td' element as the table data. Then we
SQL Alter Column Default Value
SQL Alter Column Default Value       Alter Column Default Value in  SQL Server is used with Create Table Statement. The default value will be set as per specified
sql connectivity through java
sql connectivity through java  i want an example for java db through sql connection. Thanks in advance
Getting garbage value
Getting garbage value  Thank You Sir for helping me out from the problem. Now I'm facing some problem with the value I'm passing to the textfield from the link gets some garbage value whenever I'm using some particular set
Getting garbage value
Getting garbage value  Thank You Sir for helping me out from the problem. Now I'm facing some problem with the value I'm passing to the textfield from the link gets some garbage value whenever I'm using some particular set
insert data 50 row *column into 300 row *column by using xls sheet data (50 row *column) are given in xls sheet
insert data 50 row *column into 300 row *column by using xls sheet data (50 row *column) are given in xls sheet   1- there are matrix of data with 300 row and 300 column,this is master table we have input data 50 row and 50
how to insert value in dynamic table
student table. and company and year value i'm getting through company table.but apache...how to insert value in dynamic table  i am creating a project... a dynamic table for every company.but whenever i'm inserting values to the company
Insert specific fields into table dynamically for each row.
Insert specific fields into table dynamically for each row.  There is a table containing 20 fields and 2 of those are empty. The administrator... on done the values will be inserted into database.Then he enter values for next row
Insert specific fields into table dynamically for each row.
Insert specific fields into table dynamically for each row.  There is a table containing 20 fields and 2 of those are empty. The administrator... on done the values will be inserted into database.Then he enter values for next row
Getting garbage value
Getting garbage value  Thanks for the reply. Its works well, but whenever I'm using numeric value from 0010 to 0757 it is returning some garbage value. I dont have the idea what is going wrong. Please give me some idea to solve
SQL add column default value
SQL add column default value       Add a Column default value is used in SQL, When create statement Query is performed in SQL .Usually, the default value is given

Ads