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



Home Answers Viewqa Java-Beginners Html+jsp+database is enough to do the small operation
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Ramesh Naidu
Html+jsp+database is enough to do the small operation
0 Answer(s)      3 years and 3 months ago
Posted in : Java Beginners


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.


Advertisement
View Answers

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
Small clarification
Small clarification  This function is used to search and select particular word. In this function document.getElementById('d')); getElementById is used to get the element by using id,but here there is no id with 'd', what
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
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
Search operation in JSP page
Search operation in JSP page  How to perform search in jsp with MYSQL database plz help me
search operation - Java Beginners
search operation  how to retrive all the similar elements (search operation ) on xml document using regular expressions
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
Insert Operation Error - WebSevices
Insert Operation Error  Hai, How i store my full resume in database[Mysql] using PHP. Any one Know the code..... Help me
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
small query - JSP-Servlet
small query  how to set value to textbox on browser side which is retrived from the database?  Hi friend, Plz explain problem in details which technology you have used e.g. JSP/Servlet/Java etc... For more
small code - JDBC
small code  Hi Team, I want to write program for my team in this code i have list of websites when ever this site is down this code shows site is down message and if site is up it will give message site is up. Thanks
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
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
Struts small complite project - Struts
Struts small complite project  I am a beginner in struts I want to do a project in Srtuts .can u please send me a small complete struts project . So that I can by taking the reference of that I can write good and effective
how to get small rectangular box or small window - JSP-Servlet
how to get small rectangular box or small window   Dear sir, First i am calling a one jsp in a url ,it will display that perticular jsp.In this jsp i am showing a one table ,that contains attributes like id,subject
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 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
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
Small program code - Java Beginners
Small program code  Develop the echo server and the echo client program that display whatever is typed in the server on to the client
Mysql Time Operation
Mysql Time Operation       Mysql Time Operation performs the subtraction and addition of time. Understand with Example The Tutorial illustrate an example from Mysql Time Operation
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
small java project - Java Beginners
small java project  i've just started using java at work and i need to get my self up to speed with it, can you give me a small java for beginners project to work on. your concern will be highly appreciated
small java project - Java Beginners
small java project  i've just started using java at work and i need to get my self up to speed with it, can you give me a small java for beginners project to work on. your concern will be highly appreciated
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
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
Push and Pop operation of stack.
operation of stack. In the previous tutorial is clearly explained the push pop operation. The drawback of implementing stack is that the size of stack... n,value; do { do { printf("\nEnter the element to be pushed
 

 

 

DMCA.com