Databases

Databases

how to add data dynamically into the database table?? i used back end is mysql....

View Answers

May 2, 2011 at 10:41 AM

1)form.jsp:

<html>
<form method="post" action="insertdata.jsp">
<table>
<tr><td>Name:</td><td><input type="text" name="name"></td></tr>
<tr><td>Address:</td><td><input type="text" name="address"></td></tr>
<tr><td>Contact No:</td><td><input type="text" name="contact"></td></tr>
<tr><td>Email:</td><td><input type="text" name="email"></td></tr>
<tr><td></td><td><input type="submit" value="Submit"></td></tr>
</table>
</form>
</html>

2)insertdata.jsp:

<%@page import="java.sql.*"%>
<%
String name=request.getParameter("name");
String address=request.getParameter("address");
int contact=Integer.parseInt(request.getParameter("contact"));
String email=request.getParameter("email");

        try{
        Class.forName("com.mysql.jdbc.Driver");
        Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "root");
        Statement st=con.createStatement();
        int i=st.executeUpdate("insert into employee(name,address,contactNo,email) values('"+name+"','"+address+"',"+contact+",'"+email+"')");
        out.println("Data is successfully inserted into database.");
        con.close();
        }
        catch(Exception e){
        System.out.println(e);
        }
        %>









Related Tutorials/Questions & Answers:
Switch databases
Switch databases  How do you inter-change between relational databases without code changes
Databases
Advertisements
databases
databases
databases
databases
databases
Databases supported by Jdeveloper?
Databases supported by Jdeveloper?  I want to know what databases are supported by jdeveloper ?and any light database for jdeveloper
ModuleNotFoundError: No module named 'databases'
ModuleNotFoundError: No module named 'databases'  Hi, My Python... 'databases' How to remove the ModuleNotFoundError: No module named 'databases' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'databases'
ModuleNotFoundError: No module named 'databases'  Hi, My Python... 'databases' How to remove the ModuleNotFoundError: No module named 'databases' error? Thanks   Hi, In your python environment you
How to list databases in PostgreSQL
How to list databases in PostgreSQL  Hi, I want to connect to Postgresql database and see all the databases stored in the database. How to list databases in PostgreSQL?   Hi, You can do all these with the psql prompt
mysqldump all databases
mysqldump all databases  How to take the backup of complete data including all the databases in the MySQL Server? Is there one command to take...-databases > all_databases.sql Thanks
JanusGraph Supported Databases
JanusGraph Supported Databases  Hi, I want to choose the backend for JanusGraph to store my graphs. Which all databases are supported by JanusGraph... processing engine which supports many back-end databases. Here is the list of database
Merge databases in SQL SErver 2005
Merge databases in SQL SErver 2005  Please help me to merge databases in SQL server 2005
ModuleNotFoundError: No module named 'pymedphys-databases'
ModuleNotFoundError: No module named 'pymedphys-databases'  Hi, My... named 'pymedphys-databases' How to remove the ModuleNotFoundError: No module named 'pymedphys-databases' error? Thanks   Hi
ModuleNotFoundError: No module named 'imbalanced-databases'
ModuleNotFoundError: No module named 'imbalanced-databases'  Hi...: No module named 'imbalanced-databases' How to remove the ModuleNotFoundError: No module named 'imbalanced-databases' error? Thanks   Hi
Version of cocoon>cocoon-databases dependency
List of Version of cocoon>cocoon-databases dependency
Upgrading databases between MySQL 5.0 to MySQL 5.5
Upgrading databases between MySQL 5.0 to MySQL 5.5  Upgrading databases between MySQL 5.0 to MySQL 5.5
ModuleNotFoundError: No module named 'roundcube_merge_databases'
ModuleNotFoundError: No module named 'roundcube_merge_databases'  Hi...: No module named 'roundcube_merge_databases' How to remove the ModuleNotFoundError: No module named 'roundcube_merge_databases' error? Thanks  
Biological Databases Links
Biological Databases       Biological Databases are like any other databases... databases: Biological Database LinksADS_TO_REPLACE_1
is it possible to connect the multiple databases from the hibernate application
is it possible to connect the multiple databases from the hibernate application  is it possible to connect the multiple databases from the hibernate application,if it is possible then tell me with step wise manner
Maven Dependency cocoon-databases >> 2.1.3
You should include the dependency code given in this page to add Maven Dependency of cocoon >> cocoon-databases version2.1.3 in your project
Maven Dependency cocoon-databases >> 2.1.4
You should include the dependency code given in this page to add Maven Dependency of cocoon >> cocoon-databases version2.1.4 in your project
Maven Dependency cocoon-databases >> 2.1.5.1
You should include the dependency code given in this page to add Maven Dependency of cocoon >> cocoon-databases version2.1.5.1 in your project
Maven Dependency cocoon-databases >> 2.1.6
You should include the dependency code given in this page to add Maven Dependency of cocoon >> cocoon-databases version2.1.6 in your project
Maven Dependency cocoon-databases >> 2.1.7
You should include the dependency code given in this page to add Maven Dependency of cocoon >> cocoon-databases version2.1.7 in your project
Maven Dependency cocoon-databases >> 2.1.8
You should include the dependency code given in this page to add Maven Dependency of cocoon >> cocoon-databases version2.1.8 in your project
Hibernate 4 Supported Databases List
Hibernate 4 Supported Databases List In this tutorial you will learn that how many databases are supported by Hibernate. You must be looking for the list... of time it can be configured to work with other databases. This feature of Hibernate
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
connecting databases
conflicting databases
conflicting databases
Maven Repository/Dependency: cocoon | cocoon-databases
Maven Repository/Dependency of Group ID cocoon and Artifact ID cocoon-databases. Latest version of cocoon:cocoon-databases dependencies. # Version Release Date 1 2.1.9
Maven dependency for cocoon - cocoon-databases version 2.1.9 is released. Learn to use cocoon-databases version 2.1.9 in Maven based Java projects
Maven dependency for  cocoon  - Version 2.1.9 of cocoon-databases released The developers of   cocoon - cocoon-databases project have... of  cocoon - cocoon-databases library is 2.1.9. Developer can use
Maven dependency for cocoon - cocoon-databases version 2.1.8 is released. Learn to use cocoon-databases version 2.1.8 in Maven based Java projects
Maven dependency for  cocoon  - Version 2.1.8 of cocoon-databases released The developers of   cocoon - cocoon-databases project have... of  cocoon - cocoon-databases library is 2.1.8. Developer can use
Maven dependency for cocoon - cocoon-databases version 2.1.7 is released. Learn to use cocoon-databases version 2.1.7 in Maven based Java projects
Maven dependency for  cocoon  - Version 2.1.7 of cocoon-databases released The developers of   cocoon - cocoon-databases project have... of  cocoon - cocoon-databases library is 2.1.7. Developer can use
Maven dependency for cocoon - cocoon-databases version 2.1.6 is released. Learn to use cocoon-databases version 2.1.6 in Maven based Java projects
Maven dependency for  cocoon  - Version 2.1.6 of cocoon-databases released The developers of   cocoon - cocoon-databases project have... of  cocoon - cocoon-databases library is 2.1.6. Developer can use
Maven dependency for cocoon - cocoon-databases version 2.1.5.1 is released. Learn to use cocoon-databases version 2.1.5.1 in Maven based Java projects
Maven dependency for  cocoon  - Version 2.1.5.1 of cocoon-databases released The developers of   cocoon - cocoon-databases project have... of  cocoon - cocoon-databases library is 2.1.5.1. Developer can use
Maven dependency for cocoon - cocoon-databases version 2.1.4 is released. Learn to use cocoon-databases version 2.1.4 in Maven based Java projects
Maven dependency for  cocoon  - Version 2.1.4 of cocoon-databases released The developers of   cocoon - cocoon-databases project have... of  cocoon - cocoon-databases library is 2.1.4. Developer can use
Maven dependency for cocoon - cocoon-databases version 2.1.3 is released. Learn to use cocoon-databases version 2.1.3 in Maven based Java projects
Maven dependency for  cocoon  - Version 2.1.3 of cocoon-databases released The developers of   cocoon - cocoon-databases project have... of  cocoon - cocoon-databases library is 2.1.3. Developer can use
codes for banking databases
codes for banking databases
codes for banking databases
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 data in databases created in ecplise using jsp
problem in inserting data in databases created in ecplise using jsp  <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ page import="java.sql.*" %> JS Soft
problem in inserting data in databases created in ecplise using jsp
problem in inserting data in databases created in ecplise using jsp  <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ page import="java.sql.*" %> JS Soft
java code to validate column content of 2 different tables in 2 different databases.
java code to validate column content of 2 different tables in 2 different databases.  Database have been migrated from old to new one as per.... how to compare 2 columns(different col_name) in 2 different databases placed
Java Servlet - matching 2 databases - Java Beginners
Open Source Databases
Open Source Databases The Open Source Database Benchmark Featuring... Source Databases: A brief look This month I take a brief look at Open Source... databases? Most readers have probably heard of MySQL. Its byline is The World's most
Video Tutorial: Hibernate 4 Supported Databases List
Hibernate 4 Supported Databases List Hibernate being an object relational... relational impedance. It also handles the function of a of the databases which... databases. Here, the list of Hibernate 4 was compiled which supports the MySQL

Ads