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



Home Answers Viewqa JSP-Servlet code to establish jdbc database connectivity in jsp
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


pirarthani.p
code to establish jdbc database connectivity in jsp
1 Answer(s)      2 years and 5 months ago
Posted in : JSP-Servlet


Dear sir, i'm in need of code and procedure to establish jdbc connectivity in jsp.


Advertisement
View Answers

August 8, 2012 at 12:39 PM


Here is a simple jsp code that accepts the values from user and insert them into the database using jdbc.

1)form.jsp:

<html>
<form method="post" action="insert.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></td><td><input type="submit" value="Submit"></td></tr>
</table>
</form>
</html>

2)insert.jsp:

<%@page import="java.sql.*"%>
<%
String name=request.getParameter("name");
String address=request.getParameter("address");
Class.forName("com.mysql.jdbc.Driver").newInstance();
        Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "root" );
           Statement st=con.createStatement();
           int i=st.executeUpdate("insert into user(name,address) values('"+name+"','"+address+"')");
           out.println("Data is inserted successfully");
%>

For more information, visit the following links:

http://www.roseindia.net/jsp/connect-jsp-mysql.shtml

http://www.roseindia.net/jsp/Accessingdatabase-fromJSP.shtml



Related Tutorials/Questions & Answers:
code to establish jdbc database connectivity in jsp
code to establish jdbc database connectivity in jsp  Dear sir, i'm in need of code and procedure to establish jdbc connectivity in jsp
code to establish jdbc database connectivity in jsp
code to establish jdbc database connectivity in jsp  Dear sir, i'm in need of code and procedure to establish jdbc connectivity in jsp
Advertisements
The required JDBC drivers to establish connectivity to my database part of the JDK.
The required JDBC drivers to establish connectivity to my database part of the JDK.  Are all the required JDBC drivers to establish connectivity to my database part of the JDK
code to validate username password of gmail and procedures to establish jdbc connectivity to store unread mails and retreive it..
. 3) code and procedure to establish jdbc connectivity and to store...code to validate username password of gmail and procedures to establish jdbc..., 1)I am in need of code to establish username and password of gmail
code to validate username password of gmail and procedures to establish jdbc connectivity to store unread mails and retreive it..
. 3) code and procedure to establish jdbc connectivity and to store...code to validate username password of gmail and procedures to establish jdbc..., 1)I am in need of code to establish username and password of gmail
code to validate username password of gmail and procedures to establish jdbc connectivity to store unread mails and retreive it..
. 3) code and procedure to establish jdbc connectivity and to store...code to validate username password of gmail and procedures to establish jdbc..., 1)I am in need of code to establish username and password of gmail
code to validate username password of gmail and procedures to establish jdbc connectivity to store unread mails and retreive it..
. 3) code and procedure to establish jdbc connectivity and to store...code to validate username password of gmail and procedures to establish jdbc..., 1)I am in need of code to establish username and password of gmail
code to validate username password of gmail and procedures to establish jdbc connectivity to store unread mails and retreive it..
. 3) code and procedure to establish jdbc connectivity and to store...code to validate username password of gmail and procedures to establish jdbc..., 1)I am in need of code to establish username and password of gmail
database connectivity using jsp code
database connectivity using jsp code  i have two tables employee...),'bbbb','bbbb'); so this syntax is possible to use in jsp code based on employee id ename and designation are displayed how it is possible in jsp employee
Database connectivity with jsp code - JSP-Servlet
Database connectivity with jsp code  I have written a program in java having connectivity with online_exam. Its working properly. Connection has been established and the code in java is showing the output. But the problem
database connectivity - JDBC
database connectivity  can u ppl pls provide me with database connectivity programs with MSacces   Hi Friend, If you havn't create your... a user DSN 4. Select Microsoft Access Driver(*.mdb) 5. Select database name
database connectivity - JDBC
database connectivity  example java code for connecting Mysql database using java  Hi friend, Code for connecting Mysql database using...."); Connection conn = null; String url = "jdbc:mysql://localhost:3306
database connectivity in java - JDBC
database connectivity in java  import java.io.*; import java.awt.... images\\collapsed.gif"); l1=new JLabel("Code:"); l2=new JLabel("Name:"); l3=new JLabel("Mobile:"); l4=new JLabel("Email:"); l5=new JLabel("Code
jdbc connectivity through jsp
jdbc connectivity through jsp  my code: <%@ page language="java... = ""; String url = "jdbc:mysql://localhost/interviewer...; </html> ______________________end of the code
JDBC - Java Database Connectivity Tutorial
JDBC - Java Database Connectivity Tutorials  ...; New Features in JDBC 4.0 Java database connectivity (JDBC) is the Java... rows. JDBC Tutorials JDBC (Java Database Connectivity
DataBase connectivity in java with Microsoft sql server2000 - JDBC
DataBase connectivity in java with Microsoft sql server2000  How i can achieve database connectivity with Microsoft sql server2000 in my java source code
JDBC Connectivity Code In Java
JDBC Connectivity Code In Java       In this Tutorial we want to describe you a code that helps you in understanding JDBC Connectivity Code in Java. In this program, the code
online database connectivity issue from JSP page .
online database connectivity issue from JSP page .  Hi; Everything working fine in localhost , but facing a simple problem in connectivity with database from my web site. In my local host-- when I am typing following code
online database connectivity issue from JSP page .
online database connectivity issue from JSP page .  Hi; Everything working fine in localhost , but facing a simple problem in connectivity... following code in online connectivity ---- Class.forName
online database connectivity issue from JSP page .
online database connectivity issue from JSP page .  Hi; Everything working fine in localhost , but facing a simple problem in connectivity with database from my web site. In my local host-- when I am typing following code
Could not establish the connection to oracle - JDBC
Could not establish the connection to oracle  Hi Friends, I am working on JDBC.My program is to insert the data into student database. I am... not establish the connection
JDBC, Java Database Connectivity
tutorials. Java Database Connectivity or JDBC for short is Java bases API... driver as per your application needs. About JDBC Java Database Connectivity... to the database developers uses JDBC API to perform insert, update, select
JDBC CONNECTIVITY
JDBC CONNECTIVITY  How do i connect my database to java. I have the connector file and i place it in lib of jdk folder and installed the jdbc driver... file in environment variable.   Java Mysql connectivity Other JDBC
database connectivity
database connectivity  how to create database connectivity between HTML and sql server2005
database connectivity
database connectivity  describe java program steps in order to get connectivity to database along with example
JDBC CONNECTIVITY
connectivity Other JDBC Tutorials...JDBC CONNECTIVITY  import java.sql.Connection; import..."); con = DriverManager.getConnection("jdbc:mysql://localhost:3306/abhi
connectivity - JDBC
I tried to connect to database and insert data it is showing exeception...) org.apache.jsp.gui1_jsp._jspService(gui1_jsp.java:142...(DriverManager.java:171) org.apache.jsp.gui1_jsp._jspService(gui1_jsp.java:70
Database Connectivity
Database Connectivity  I tried to establish database connection with sqlserver2008 through GlassFish server. When I set the path of sqljdbc.jar(E:\Glass Fish\glassfish-v2ur1\javadb\lib\sqljdbc.jar) it shows me error
JDBC-Odbc Connectivity
JDBC-ODBC Connectivity       The code illustrates an example from JDBC-ODBC Connectivity. The code helps you in retrieve the name and size of the column
Database Connectivity Example In Java
Database Connectivity Example In Java In this section we will read about how to establish a connection between Java program and database. To establish a connection between the database and Java program Java provides the JDBC API
connectivity - JDBC
connectivity  How can we connect sql server using Java   Hi Friend, By using JDBC drivers, you can connect SQL server with java. Please visit the following link: http://www.roseindia.net/jdbc/jdbc.shtml
 

 

 

DMCA.com