How to Insert/Save in Oracle 11g DB

How to Insert/Save in Oracle 11g DB

In this Video I m telling you about how to insert or Save , user Data in Oracle Database

Mysql insert/Save Video Link : Coming Soon
MS Access insert/Save Video Link : Coming Soon

All Source is Below

name - register.html

<title>registration form</title>
<h2 ALIGN="CENTER">Student Registration form</h2>
<form action="/examples/stregistration"  method="post">
<table border="0" align="center">
<td><label for="rolln0">Rollno: </label></td>
<td><input id="rollno" maxlength="50" name="rollno" type="text" /></td>
<td><label for="name">Name: </label></td>
<td><input id="name" maxlength="50" name="name" type="text" /></td>
<td><label for="email">Email_Address:</label></td>
<td><input id="email" maxlength="50" name="email" type="text" /></td>
<td align="right"><input name="Submit" type="Submit" value="Submit" /></td>

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class stregistration
  extends HttpServlet
  static final String JDBC_DRIVER = "oracle.jdbc.driver.OracleDriver";
  static final String DB_URL = "jdbc:oracle:thin:@localhost:1521:XE";
  static final String USER = "system";
  static final String PASS = "system";

  public void doPost(HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse)
    throws IOException, ServletException
    String str1 = paramHttpServletRequest.getParameter("rollno");
    String str2 = paramHttpServletRequest.getParameter("name");
    String str3 = paramHttpServletRequest.getParameter("email");

    Connection localConnection = null;
    Statement localStatement = null;

      localConnection = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE", "system", "system");

      System.out.println("Creating statement...");
      if (localConnection == null) {
        System.out.println("Connection failed");
      localStatement = localConnection.createStatement();
        String str10 = "Insert  into student(roll,name,email) values('" + str1 + "','" + str2 + "','" + str3 + "')";
        System.out.println("Statement executed " + str10);


    catch (SQLException localSQLException)
    catch (Exception localException)

name successfullydone.html
<font size="18" color="red">SuccessFully Done</font>

<a href="http://localhost:8089/examples/view.jsp" target="_blank">View Database</a>

<a href="http://localhost:8089/examples/register.html">BACK TO HOME</a>
name view.jsp
<style type="text/css">
table {
		width: 100%;
		border-collapse: collapse;

/* Zebra striping */
	tr:nth-of-type(odd) {
		background: #eee;

th {
		background: #333;
		color: white;
		font-weight: bold;

	td, th {
		padding: 6px;
		border: 1px solid #ccc;
		text-align: left;


 <body background="images/bgnoise_lg.png">
<h1><center><ax>Student Record</ax> </center></h1>
<body background="bgnoise_lg.png">

<%@ page import="java.sql.*" %>
<%@ page import ="tybca.*" %>
<form  method="POST">

<%  String JDBC_DRIVER = "oracle.jdbc.driver.OracleDriver";   String DB_URL = "jdbc:oracle:thin:@localhost:1521:XE"; String USER = "system"; String PASS = "system";    Connection conn = null;    Statement stmt = null; ResultSet rs = null; Class.forName(JDBC_DRIVER); conn =DriverManager.getConnection(DB_URL,USER,PASS); stmt=conn.createStatement(); String sql="select * from student"; System.out.println("Created Statement"+sql); rs=stmt.executeQuery(sql); //rs.close(); //stmt.close(); //conn.close(); while( { %>
<%= rs.getInt(1) %></td>
<%= rs.getString(2) %></td>
<%= rs.getString(3) %></td>
<% } %>

<a href="http://localhost:8089/examples/register.html">BACK TO HOME</a>

how to insert values into table in mysql using java
how to insert values into table in oracle using java
insert query in java using prepared statement
inserting data into database using java netbeans
how to insert values into table in mysql using java in eclipse
inserting data into mysql database using java
how to store data in database using java
java code for inserting data into database
java jdbc insert example


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s