Home Discussion Discuss: Free JSP Books

  • getting input in database through jsppratiksha August 11, 2011 at 9:24 PM

    i wants to know that how i take input from the user(a jsp page)and the info.of the user is stored in underlying database. plz help here i post code... <%-- Document : newjsp Created on : Aug 3, 2011, 4:38:00 PM Author : Administrator --%> <%@page contentType="text/html" pageEncoding="UTF-8" import="java.io.*" %> <%@page import="java.sql.*" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Registration</title> </head> <body> <form action="registration.jsp"> <h1 align="centre" onmouseclick= "E-Krishi Registration Form" > REGISTRATION FORM </h1> </br> </br> </br> </br> <table width="30%"> <tr> <th width="80%">First Name : </th> <td width="50%"> <input type="text" name="first_name" value="" size="20" /></td> </tr> </br> </br> <tr> <th width="50%">Last Name :</th> <td width="50%"> <input type="text" name="last_name" value="" size="20" /></td> </tr> </br> </br> <tr> <th width="50%">Login Name :</th> <td width="50%"> <input type="text" name="login_name" value="" size="20" />@Ekrishi.com</td> </tr> </br> </br> <tr> <th width="50%">Password:</th> <td width="50%"> <input type="password" name="passwrd" value="" size="20" /> </td> </tr> </br> </br> <tr> <th width="50%">Re-Enter Password : </th> <td width="50%"> <input type="password" name="re_enter_passwrd" value="" size="20" /> </td> </tr> </br> </br> <tr> <th width="50%">Security Question :</th> <td width="50%"> <select name="security_ques"> <option>what is your childhood friend name?</option> <option>what is your pet name?</option> <option>what is your favourite dish name?</option> <option>what is your first teacher name?</option> <option>what is your mother favourite dish?</option> </select></td> </tr> </br> </br> </br> <tr> <th width="50%"> Answer : </th> <td width="50%"> <input type="text" name="answer" value="" size="20" /> </td> </tr> </br> </br> </br> <tr> <th width="50%">Recovery E-mail address : </th> <td width="50%"><input type="text" name="recovery_e-mail_add" value="" size="20" /> </td> </tr> </br> </br> </br> <tr> <th width="50%">Profession :</th> <td width="50%"><select name="profession"> <option>FARMER</option> <option>WHOLESALER</option> <option>OTHERS</option> </select></td> </tr> </br> </br> </br> <tr> <th width="50%">State:</th> <td width="50%"><select name="location"> <option>Andhra Pradesh </option> <option>Arunachal Pradesh</option> <option>Assam</option> <option>Bihar</option> <option>Chhattisgarh</option> <option>Goa</option> <option>Gujarat</option> <option>Haryana</option> <option>Himachal Pradesh</option> <option>Jammu and Kashmir</option> <option>Jharkhand</option> <option>Karnataka</option> <option>Kerala</option> <option>Madhya Pradesh</option> <option>Maharashtra</option> <option>Manipur</option> <option>Mizoram</option> <option>Meghalaya</option> <option>Nagaland</option> <option>Orissa</option> <option>Punjab</option> <option>Rajasthan</option> <option>Sikkim</option> <option>Tamil Nadu</option> <option>Tripura </option> <option>Uttar Pradesh</option> <option>Uttarakhand</option> <option>West Bengal </option> </select></td> </tr> </br> </br> <tr> <th width="50%"> Location : </th> <td width="50%"><input type="text" name="location" value="" size="20" /> </td> </tr> </br> </br> <tr> <th width="50%">Contact Number :</th> <td width="50%"><input type="text" name="contact_no" value="" size="20" /> </tr> </br> </br> <tr> <th></th> <td width="50%"> <input type="submit" value="submit" name="reg_submit" /> </td> </tr> </table> <% Connection con; String url = "jdbc:odbc:krishi1"; String driver = "sun.jdbc.odbc.JdbcOdbcDriver"; int sumcount = 0; Statement st; try { Class.forName(driver); } catch (ClassNotFoundException c) { c.printStackTrace(); } con = DriverManager.getConnection(url); PreparedStatement pstatement = null; st = con.createStatement(); int updateQuery = 0; String First_name = request.getParameter("First_name"); String Last_name = request.getParameter("Last_name"); String Login_name = request.getParameter("Login_name"); String Password = request.getParameter("Password"); String re_enter_password = request.getParameter("re_enter_password"); String security_ques = request.getParameter("security_ques"); String answer = request.getParameter("answer"); String recovery_email = request.getParameter("recovery_email"); String profession = request.getParameter("profession"); String state = request.getParameter("state"); String location = request.getParameter("location"); String contact_no = request.getParameter("contact_no"); // if (First_name != null && Last_name != null && Login_name!=null && Password != null && re_enter_password != null && security_ques != null && answer != null && recovery_email != null && profession != null && state != null && location != null && contact_no != null) { // if (First_name != "" && Last_name != "" && Login_name!="" && Password != "" && re_enter_password != "" && security_ques != "" && answer != "" && recovery_email != "" && profession != "" && state != "" && location != "" && contact_no != "") { try { String queryString = "insert into reg (fname,lname,Logname,password,rpassword,sques,ans,remail,profession,state,location,contact) values ('"+First_name+"','"+Last_name+"','"+Login_name+"','"+Password+"','"+re_enter_password+"','"+security_ques+"','"+answer+"','"+recovery_email+"','"+profession+"','"+state+"','"+location+"','"+contact_no+"')"; // ResultSet rs = st.executeQuery("insert into e-krishi_registration (First_name,Last_name,Login_name,Password,Re-enter password,Security question,Answer,Recovery email address,profession,State,Location,contact number) values (?,?,?,?,?,?,?,?,?,?,?,?)"); // ResultSet rs = st.executeUpdate(queryString); pstatement = con.prepareStatement(queryString); // pstatement.setString(1, First_name); // pstatement.setString(2, Last_name ); // pstatement.setString(3, Login_name); // pstatement.setString(4, Password); // pstatement.setString(5, re_enter_password); //pstatement.setString(6, security_ques); // pstatement.setString(7, answer); // pstatement.setString(8, recovery_email); //pstatement.setString(9, profession); //pstatement.setString(10, state); //pstatement.setString(11, location); //pstatement.setString(12, contact_no); updateQuery = pstatement.executeUpdate(); if (updateQuery != 0) { %> <br> <TABLE style="background-color: #E3E4FA;" WIDTH="30%" border="1"> <tr><th>Data is inserted successfully in database.</th></tr> </TABLE> <% } } catch (SQLException e) { e.printStackTrace(); } // }// // } %> </form> </body> </html> tell me where iam wrong... thankyou

  • jspnishant September 8, 2011 at 8:38 PM

    i need jsp book

  • JavaManjit February 17, 2012 at 8:15 AM

    Likes site

  • readingrahul August 31, 2012 at 4:52 PM

    interesting explain of jsp

  • JSP Ebookkrishna joshi January 9, 2014 at 1:06 AM

    Sir can you plz mail me the ebook of jsp.... I hope this book contains everything from basic about jsp programming with examples.......

Post your Comment

Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
Related Articles
JSP Servlet Questions

searching books
searching books  how to write a code for searching books in a library through jsp 

Free Programming books

Programming Books
Free Java Books Free JSP Books... Programming Books A Collection of Large number of Free... books and download these books for future reference. These Free Computer Books 

Java Server Faces - JSF

JSF Books
JSF Books          Introduction of JSF Books When we... Books Judging from the job advertisements in employment web sites 

JSP Servlet Questions

Need E-Books - JSP-Servlet


Ajax Books
Ajax Books       AJAX - Asynchronous JavaScript and XML - some books and resource links  These books... there have been few books on DHTML and only 2-3 that cover AJAX. But that will change 

Free Programming books

Struts Books
;   Free Struts Books The Apache... Struts Books         Professional Struts Books book 

Free Programming books

EJB Books
EJB Books         Professional EJB Books Written.... He commits none of the popular sins of J2EE books (he neither tries to teach 

Free Java books

Java Programming Books
Java Programming Books        ... As the author of computer books, I spend a lot of time loitering in the computer... the behavior of shoppers browsing through the books as if they were a hominid jawbone 

Free Java books

Free Java Books
Free Java Books         Sams Teach Yourself Java 2 in 24 Hours As the author of computer books, I spend a lot...; Noble and Borders, observing the behavior of shoppers browsing through the books 

Ajax Questions

Ajax books
Ajax books  Hi, Which is the best Ajax books? Thanks   Hi, Please see Ajax Books. If you are publisher of ajax books email the detail to deepak@roseindia.net. We will then publish the link of your books. Thanks 

Free Programming books

CORBA and RMI Books
CORBA and RMI Books      ... and CORBA The standard by which all other CORBA books are judged, Client..., JSP, and Servlets CodeNotes provides the most succinct, accurate 

Free Programming books

Servlets Books
;    Books : Java Servlet & JSP Cookbook... leading free servlet/JSP engines- Apache Tomcat, the JSWDK, and the Java Web Server... Servlets Books         

Free Programming books

Tomcat Books
, there are currently few books and limited online resources to explain the nuances of JSP... Tomcat Books        ... of your site.    Tomcat Works This is one of the rare books 

JSP Tutorials

Free JSP Books
Free JSP Books          Download the following JSP books... it is sent by POST.   How to using JSP HTML Form 

Free Programming books

JSP Programming Books
JSP Programming Books        ... content authored by the JSP Insiders, all free, no registration required. If you... and services. Servlets and JSP technology is the foundation 

Free Programming books

Free JSP Books
Free JSP Books         Web Server Java: Servlets and JSP This chapter covers Web Server Java... Insiders, all free, no registration required. If you are interested in links to JSP 

JSP Tutorials

Free JSP download Books
Free JSP download Books          Java Servlets and JSP free download books... optimization.      The Professional JSP Books The JDC 

Java Beginners

Books Of Java - Java Beginners
Books Of Java  Which Books Are Available for Short / Quick Learning 

JSP Tutorials

JSP PDF books
; The free servlet and JSP Books Slides and exercises from Marty Hall's world...JSP PDF books          Collection is jsp books in the pdf format 

Programming Tutorials

VoIP Books
VoIP Books VoIP Books Voice over IP With a potential 90 percent....    Practical VoIP Using VOCAL While many books describe the theory... books writers review the best VoIP books available on the market. Browse our 

Free Programming books

Web Sphere Books
Web Sphere Books        ... books and manuals page". Most libraries and system requirements...; Introduction to Java Using WebSphere Books A step-by-step, hands 

Free Programming books

Java server Faces Books
the third free by using code OPC10 in our shopping cart. This deal includes books... Java server Faces Books      ... (JSP), and JSTL. In addition, this book covers the standard components, renderers 

JSP Tutorials

Accessing database from JSP
Accessing database from JSP   ... take a example of Books database. This database contains a table named books... that we write a html page for inserting the values in 'books_details' table 


Struts Book - Popular Struts Books
, the Jakarta-Tomcat JSP/servlet container, and much more. Struts Books... Struts Book - Popular Struts Books Programming Jakarta... potential. He calls the books, "the culmination of lessons learned (the hard way 


MySQL Books
MySQL Books       List of many MySQL books. MySQL Books Hundreds of books and publications related to MySQL are in circulation that can help you get the most of out MySQL. These books 

Free Programming books

J2ME Books
J2ME Books         Free J2ME Books J2ME programming camp... covered by many other books. After a comprehensive analysis of the landscape 


VoIP Books
VoIP Books          Practical VoIP book Using VOCAL While many books describe... the source code.     Switching to VoIP Books More and more 


Open Source Books
, with an emphasis on free books. The number of free books and the number of open-source.... If you're interested in old public-domain books that are free on the web, check out... Open Source Books Open Books O'Reilly has published a number 

Design concepts & design patterns Questions

java script books - Design concepts & design patterns

Free XML books

Java XML Books
;    Free Java XML Books... Java XML Books         Java and XML Books One night