Html+jsp+database is enough to do the small operation

Ads
 

Html+jsp+database is enough to do the small operation

Hai ,

If u want to do simple insetion and data retrival operation throw jsp ?.you need not to bother about whole code.just u consentration on html,ajax,jsp,any db.here i am using db2.

Html for insertion:

 <form name="StudentForm" method="post" action="simple.jsp">



  <table border="1" width="30%">

  <tr>

   <td align="center" colspan="2">  <font face="Monotype" size="5">Registration</font></td>

  </tr>

  <tr>

  <td>  Student id: </td>  <td> <input type="text" name="sId"  size="20"></td>

  </tr>
  <tr>

  <td>  Student Name: </td>  <td> <input type="text" name="sName"  size="20"></td>

  </tr>
  <tr>

  <td>  Student Age: </td>  <td> <input type="text" name="sAge"  size="20" onKeyup="isInteger(this.value)"></td>

  </tr>

 <tr> 

  <td> Student Department: </td><td><input type="text" name="sDept" size="20" /></td>

  </tr>

  <tr>

  <td align="center" colspan="2"> <input type="submit"   value="Save" "




 <input type="button"   value="Cancle" >

 </td>

  </tr>
  </table>

  </form>
Jsp:Simple.jsp


<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>

<%@page import="java.sql.*"%>
<html>
<head>
</head>

<%
String sId = request.getParameter("sId");//read the data from html page and store sId variable
String sName = request.getParameter("sName");
String sAge = request.getParameter("sAge");
String sDept = request.getParameter("sDept");
String sId1 = request.getParameter("sId");
int f=Integer.parseInt(sAge);
out.println(sId);
out.println(sName);
out.println(sAge);
out.println(sDept);
out.println(f);

        Connection conn = null;
          ResultSet result = null;
         Statement stmt = null;
         String Query=" INSERT INTO STUD(S_SID,S_NAME,S_CONTACT,S_DEPT) VALUES ('"+sId+"','"+sName+"',"+f+",'"+sDept+"') ";

        // out.println(Query);
         try {

     Class.forName("com.ibm.db2.jcc.DB2Driver");

       conn = DriverManager.getConnection("jdbc:db2://59.145.105.55:50000/tsttrial","trialadm","trial123");
       out.println(conn);
        out.println("connection successfully");

        stmt =conn.createStatement();

        int r=stmt.executeUpdate(Query);
        out.println("Student information successfully inserted");
     }
     catch (SQLException e) {
         System.out.println("Error occurred " + e);
      }

%>

it is enough to data insertion....From G RameshNaidu.

View Answers

Ads









Related Tutorials/Questions & Answers:
Html+jsp+database is enough to do the small operation
Html+jsp+database is enough to do the small operation  Hai , If u want to do simple insetion and data retrival operation throw jsp ?.you need not to bother about whole code.just u consentration on html,ajax,jsp,any db.here i
RetController.java (do get) (my file for reference for a test.. IS LOGIC good Enough ?
RetController.java (do get) (my file for reference for a test.. IS LOGIC good Enough ?   try { Connection conn=Create_Connection.conOpen(); System.out.println(conn); String submit
Advertisements
how to do CRUDE operation in iphone?-RV
how to do CRUDE operation in iphone?-RV  .h file #import <...]; //[self RemoveData]; sqlite3 *database; static sqlite3_stmt * addStmt...) NSAssert1(0, @"Failed to create writable database file with message
ModuleNotFoundError: No module named 'enough'
ModuleNotFoundError: No module named 'enough'  Hi, My Python... 'enough' How to remove the ModuleNotFoundError: No module named 'enough'... to install padas library. You can install enough python with following command
ModuleNotFoundError: No module named 'enough'
ModuleNotFoundError: No module named 'enough'  Hi, My Python... 'enough' How to remove the ModuleNotFoundError: No module named 'enough'... to install padas library. You can install enough python with following command
ModuleNotFoundError: No module named 'enough'
ModuleNotFoundError: No module named 'enough'  Hi, My Python... 'enough' How to remove the ModuleNotFoundError: No module named 'enough'... to install padas library. You can install enough python with following command
ModuleNotFoundError: No module named 'small-small-hr'
ModuleNotFoundError: No module named 'small-small-hr'  Hi, My... named 'small-small-hr' How to remove the ModuleNotFoundError: No module named 'small-small-hr' error? Thanks   Hi, In your python
login/logout operation
login/logout operation  how to do log in/out operations in jsp plz kindly send the steps leing behind this operation...: http://www.roseindia.net/jsp/loginstatus.shtml http://www.roseindia.net/jsp
ModuleNotFoundError: No module named 'small'
ModuleNotFoundError: No module named 'small'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'small' How to remove the ModuleNotFoundError: No module named 'small'
ModuleNotFoundError: No module named 'small'
ModuleNotFoundError: No module named 'small'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'small' How to remove the ModuleNotFoundError: No module named 'small'
login/logout operation
login/logout operation  how to do log in/out operations in jsp plz kindly send the steps leing behind this operation...: http://www.roseindia.net/jsp/loginstatus.shtml http://www.roseindia.net/jsp
ModuleNotFoundError: No module named 'insecure-but-secure-enough'
ModuleNotFoundError: No module named 'insecure-but-secure-enough'  Hi...: No module named 'insecure-but-secure-enough' How to remove the ModuleNotFoundError: No module named 'insecure-but-secure-enough' error? Thanks
Small business administration classes
Small business administration classes  Hi, How Small business...   Hi, The manage of any small business are doing a lot of different types... process of the business. So, if you are a manager of small business then you
Search operation in JSP page
Search operation in JSP page  How to perform search in jsp with MYSQL database plz help me
Small business management courses online
. However only education degree is not enough for successfully running a small...Small business management courses online Small-scale business today has... for running a small-scale business or becoming a large business entrepreneur. Management
ModuleNotFoundError: No module named 'small-vision'
ModuleNotFoundError: No module named 'small-vision'  Hi, My Python... 'small-vision' How to remove the ModuleNotFoundError: No module named 'small-vision' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'SudachiDict-small'
ModuleNotFoundError: No module named 'SudachiDict-small'  Hi, My... named 'SudachiDict-small' How to remove the ModuleNotFoundError: No module named 'SudachiDict-small' error? Thanks   Hi, In your
Cloud Computing Solutions for Small Business
Cloud Computing Solutions for Small Business  Hi, Which Cloud Computing Solutions for Small Business is good. How to choose best Cloud Computing Solutions for Small Business. There are many small business around the world
What are prospects of small Business management?
Small business management is the process by which all the available resources.... As by name, it is the case of small business management so such business activity starts with a very low cost and on a part time basis. Small business starts
Java code for buffer operation...!!!
Java code for buffer operation...!!!  Implement a buffer operation using character array, storing last 100 characters inserted by user. Make method to get and retrieve???   The given code accepts the characters from
Searching operation in JAva
Searching operation in JAva  Sir, I have made a project... search using date, letter no., subject all at once. I'm using servlet and jsp...://www.roseindia.net/jsp/searchbook.shtml
Searching operation in JAva
Searching operation in JAva  Sir, I have made a project... search using date, letter no., subject all at once. I'm using servlet and jsp...://www.roseindia.net/jsp/searchbook.shtml
Searching operation in JAva
Searching operation in JAva  Sir, I have made a project... search using date, letter no., subject all at once. I'm using servlet and jsp...://www.roseindia.net/jsp/searchbook.shtml
Searching operation in JAva
Searching operation in JAva  Sir, I have made a project... search using date, letter no., subject all at once. I'm using servlet and jsp...://www.roseindia.net/jsp/searchbook.shtml
arithmetic operation on float number
arithmetic operation on float number  hi here is my code class divs { public static void main(String args[]) { double dub=14.2f,dou; int num; num=(int)dub; dou=dub-num
Small typo at SCJP Module-1 Question-6
Small typo at SCJP Module-1 Question-6  Hi Team, This is a awesome site which is serving lot of peoples in learning java effectivly, thanks alot for that, A small typo at "SCJP Module-1 Question-6", in spite of "a.method
ModuleNotFoundError: No module named 'kser-operation'
ModuleNotFoundError: No module named 'kser-operation'  Hi, My... named 'kser-operation' How to remove the ModuleNotFoundError: No module named 'kser-operation' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'Operation-Pluto'
ModuleNotFoundError: No module named 'Operation-Pluto'  Hi, My... named 'Operation-Pluto' How to remove the ModuleNotFoundError: No module named 'Operation-Pluto' error? Thanks   Hi, In your python
Social Media Marketing for Small Business
Social Media Marketing for Small Business We are providing Social Media Marketing for Small Business and small website owners at very attractive cost. Our Social Media Marketing services for Small Business are well designed and gives
Sql delete operation
get an answer.I used html anchor element for redirecting the page. i am using jsp with mysql 1.admincustdb.jsp : in this page contains only display the database... update delete update and delete are enclosed with html anchor element. if i
Small Business Marketing Services
Small Business Marketing Services These days Small Business around the work is looking for cheap, reliable and result oriented Small Business Marketing Services. The priority of Small Business is to find the best Small Business

Ads