Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8068357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:39:29+00:00 2026-06-05T12:39:29+00:00

What is the wrong in this code, it is not getting processing, when I

  • 0

What is the wrong in this code, it is not getting processing, when I click the submit button it forwards to this insert.jsp and blank page appears (result is failing).

/*
Form.html
*/

<html>
<form method="post" action="Insert.jsp"> //form start
<table>
<tr><td>Fname:</td><td><input type="text" name="fname"></td></tr>
<tr><td>LName:</td><td><input type="text" name="lname"></td></tr>
<tr><td>Email:</td><td><input type="text" name="email"></td></tr>
<tr><td>pass:</td><td><input type="password" name="pass"></td></tr>
<tr><td>confirm pass:</td><td><input type="password" name="cpass"></td></tr>
<tr><td>dob:</td><td><input type="text" name="dob"></td></tr>
<tr><td>age:</td><td><input type="text" name="age"></td></tr>
<tr><td>gender:</td><td><input type="text" name="gender"></td></tr>
<tr><td>address:</td><td><input type="text" name="address"></td></tr>
<tr><td>country:</td><td><input type="text" name="country"></td></tr>
<tr><td>state:</td><td><input type="text" name="state"></td></tr>
<tr><td>city:</td><td><input type="text" name="city"></td></tr>
<tr><td>telephone:</td><td><input type="text" name="tno"></td></tr>
<tr><td>Mobile:</td><td><input type="text" name="mobile"></td></tr>
<tr><td></td><td><input type="submit" value="Submit"></td></tr>
</table>
</form>
</html>

/*
Insert.jsp 
*/
<%@page import="java.sql.*,java.util.*"%> // import
<%
String fname=request.getParameter("fname");
String lname=request.getParameter("lname");
String email=request.getParameter("email");
String pass=request.getParameter("pass");
String cpass=request.getParameter("cpass");
String dob=request.getParameter("dob");
int age=Integer.parseInt(request.getParameter("age"));
String gender=request.getParameter("gender");
String address=request.getParameter("address");
String country=request.getParameter("country");
String state=request.getParameter("state");
String city=request.getParameter("city");
int tno=Integer.parseInt(request.getParameter("tno"));
int mobile=Integer.parseInt(request.getParameter("mobile"));
        try{
         Class.forName("com.mysql.jdbc.Driver");
           Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/student", "root", "");
           Statement st=con.createStatement();
           int i=st.executeUpdate("insert into student(fname,lname,email,pass,cpass,dob,age,gender,address,country,state,city,tno,mobile) values('"+fname+"','"+lname+"','"+email+"','"+pass+"','"+cpass+"','"+dob+"','"+age+"','"+gender+"',"+address+",'"+country+"','"+state+"','"+city+"','"+city+"','"+tno+"','"+mobile+"')");
        out.println("Data is successfully inserted!");
        }
        catch(Exception e){
        System.out.print(e);
        e.printStackTrace();
        }
        %>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T12:39:33+00:00Added an answer on June 5, 2026 at 12:39 pm

    Your urgency isn’t our problem.

    It’d be more helpful if you could cite a log message or a stack trace than “blank page” and “failing”.

    When you hit the submit button, what do you expect to be displayed?

    This is a bad design. You ought not have database code in your JSP. Scriptlets are a very bad idea. Learn JSTL. The <sql> tags might even be what you need.

    A better idea would be a servlet between the JSP and the database that would authenticate and authorize the user, bind and validate inputs, perform the database operations on the user’s behalf, marshal the response into request or session scope, and stream the response to the page that needed to be displayed.

    I’m guessing that you’d like to display the state of the database after the INSERT, so there ought to be a table showing all the values. How does your JSP know how to do that?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there anything wrong with this code? My entity is not getting updated. public
Can someone please tell me whats wrong with this code. I'm not getting complete
I have this code and I am not getting the expected results... whats wrong?
Not sure what is wrong with this code. I keep getting the following error:
I am not getting what is wrong with this code. It's returning Found, which
Can anybody see what is wrong with this code. it does not show up
I have this code,everything works fine but .css('color','red') rule is not getting applied.I tried
I have this following code and I am not getting the results I expected.
Whats wrong with this code? -(void) drawRect:(CGRect) rect { CGContextRef c = UIGraphicsGetCurrentContext(); if
Is there anything wrong with this code or can this be done more efficiently?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.