Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



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

Have Programming Question? Ask it here!
 
 
 


nayna kumari
value is inserted into the sql table through jsp-jdbc but not getting stored into the data base,only row is increasing.
0 Answer(s)      2 years and 2 months ago
Posted in : JSP-Servlet


<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>

Advertisement
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. Thanks
Insert Data in Table Using Stored Procedure
Insert Data in Table Using Stored Procedure   ... Your data has been inserted into table. Download this example.(Java... into a table using stored procedure. Steps: 1.Create database: To create
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
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
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... will delete the row having minimum value of ID then delete the column named
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... ===================================== Data updated successfully : See sql table to verify
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
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
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
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 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
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
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
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
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
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
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? Please clarify this. Thanks
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
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
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
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
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
Database books Page1
in manipulating data stored in Relational Database Management Systems (RDBMS). SQL provides commands through which data can be extracted, sorted, updated, deleted and inserted. SQL has the full support of ANSI (American National Standards Institute
SQL Out Parameter
SQL Out Parameter       SQL Out Parameter allows the stored procedure to the pass data... parameter  allows the stored procedure to pass the value and pass back to the invoker
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
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
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
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
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
Getting mysql table in textbox
Getting mysql table in textbox  how to get mysql table values into textbox in java using ajax and servlets
Database books
stored in Relational Database Management Systems (RDBMS). SQL provides commands through which data can be extracted, sorted, updated, deleted and inserted... SYBASE SQL Server handles all data management and transaction functions
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
to read data stored in ArrayList - Struts
to read data stored in ArrayList  this is regarding struts2, i have... them from database. Now i want to read the data of all 4 User objects from jsp file using struts2 tag. i have done the following thing, but i am getting data
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 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
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
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. Table
Processing stored procedure in MySQL - SQL
Processing stored procedure in MySQL  Dear All java with mysql developer..... i need to convert my SQL procedure to MySQL database... here is my Stored procedure in SQL.... create or replace procedure INVNAMES (bno
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
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 connectivity through java
sql connectivity through java  i want an example for java db through sql connection. Thanks in advance
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
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
SQL Auto increment Primary Key
number to be generated when a new record is inserted into a table... and data type. The following SQL statement is used to define the "Emp... SQL Auto increment Primary Key   
Advertisements
 

 

 

DMCA.com