Win a copy of Kotlin for Android App Development this week in the Kotlin forum!

hkumar patel

+ Follow
since Jul 26, 2017
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by hkumar patel

how do i create jsp page ??
i used import statement where my bean class is there and i called another class and its method where database and resultset stuff is there.
1 year ago
<!DOCTYPE html>
       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
       <title>JSP Page</title>

       <jsp:include page="index.jsp" />
       <form action="booking_process.jsp">
           Username:<input type='text'value=' <%=(String)session.getAttribute("theusername")%>' name="username" />
           <input type="radio" name="trip" value="Round Trip"/> Round Trip    
           <input type="radio" name="trip" value="One Way Trip"/>One Way Trip    
           <input type="radio" name="trip" value="Multiple City Trip"/>Multiple City  
           <input type="text" name="Source"/><br>
           <input type="text" name="Destination" /><br>
           Depart Time:
           <input type="date" name="Depart" placeholder="dd/mm/yyyy"/><br>
           Arrival Time:
           <input type="date" name="Arrival" /><br>
           <input type="text" name="class"><br>
           Passport Number:
           <input type="text" name="passport" ><br>
           Ticket Number:
           <input type="number" name="ticket"style="width:100px" value=1 min=0 max=2/><br>
           <input type="submit" value="CheckOut">


<%@page import=""%>
<jsp:useBean id="obj" class="bean.Booking_bean"/>
<jsp:setProperty name="obj" property="*" />
int i=booking.bookingTicket(obj);  
if(i>0)  {
out.print("You are successfully registered");  

* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
package bean;

import java.sql.Date;

* @author hardik
public class Booking_bean {
   private String username;
   private String type;
   private String source;
   private String Destination;
  private Date Depart;
  private Date Arrival;
  private String classtype;
  private String Passport ;
   private int Ticket ;
   public String getUsername(){
       return username;
   public void setUsername(String username){
   public String getType(){
       return type;
   public void setType(String type){
   public Date getArrival(){
       return Arrival;
   public void setArrival(Date Arrival){
   public Date getDepart(){
       return Depart;
   public void setDepart(Date Depart){
   public String getSource(){
       return source;
   public void setSource(String source){
   public String getDestination(){
       return Destination;
   public void getDestination(String Destination){
   public String getClasstype(){
       return classtype;
   public void setClasstype(String classtype){
   public String getPassport(){
       return Passport;
   public void setPassport(String Passport){
   public int getTicket(){
       return Ticket;
   public void setTicket(int Ticket){


public class booking {
   public static int bookingTicket(Booking_bean bean){
       int i=0;
          Connection c=connection_provider.getCon();
    String query = "insert into ticket_book(type,source,destination,Arrival_time,depart_time,class,Passport_number,ticket_number) values(?,?,?,?,?,?,?,?)";
   PreparedStatement st = c.prepareStatement(query);
  i= st.executeUpdate();
       catch(SQLException e){
       return i;
1 year ago