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 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
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
Advertisements
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
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
Is Python enough for data science?
Is Python enough for data science?  Hi, I am beginner in Data...: Is Python enough for data science? Try to provide me good examples or tutorials links so that I can learn the topic "Is Python enough for data science?"
Is codecademy enough to get a job?
Is codecademy enough to get a job?  Hi, I am beginner in Data...: Is codecademy enough to get a job? Try to provide me good examples or tutorials links so that I can learn the topic "Is codecademy enough to get a job?"
Is Python alone enough?
Is Python alone enough?  Hi, I am beginner in Data Science... enough? Try to provide me good examples or tutorials links so that I can learn the topic "Is Python alone enough?". Also tell me which is the good
Is Python enough for machine learning?
Is Python enough for machine learning?  Hi, I am beginner in Data...: Is Python enough for machine learning? Try to provide me good examples or tutorials links so that I can learn the topic "Is Python enough for machine
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
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
Is Python alone enough to get a job?
Is Python alone enough to get a job?  Hi, I am beginner in Data...: Is Python alone enough to get a job? Try to provide me good examples or tutorials links so that I can learn the topic "Is Python alone enough to get a job
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
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
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
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
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
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

Ads