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 7531877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:17:27+00:00 2026-05-30T05:17:27+00:00

I have been facing some serious issues while executing this particular JSP page. CODE

  • 0

I have been facing some serious issues while executing this particular JSP page.
CODE

<tr>
<td>
<%rs2 = st.executeQuery("Select * from degrees"); %>
<select name = "courses">
<%while(rs2.next()) {%>
<option value = "<%=rs2.getString(1)%>"><%=rs2.getString(2)%></option>
<%} %>
</select> 
</td>
<td>
<input type = "text" name = "ratings" class = "span1">
</td>
<td>
<a href = "">Delete Course</a>
</td>
</tr>
<%if(request.getParameter("courses")!="0"&&request.getParameter("ratings")!=null){
   String degree_id = request.getParameter("courses");
   int ratings = Integer.parseInt(request.getParameter("ratings"));
   PreparedStatement ps = con.prepareStatement("Insert into college_degree values (?,?,?)");
   ps.setString(1,college_id);
   ps.setString(2,degree_id);
   ps.setInt(3,ratings);
   ps.executeUpdate();
   c_a = Integer.parseInt(course_added);
   c_a++;
   String str = Integer.toString(c_a);
   course_added = str;
   String site = new String("degree_to_college.jsp?course_added="+course_added);
   response.setStatus(response.SC_MOVED_TEMPORARILY);
   response.setHeader("Location", site);  
}

%>
</tbody>
</table>
<form action = "degree_to_college.jsp">
<input type = "submit" class = "btn-primary large" value = "NEW COURSE" />
</form>**

Here thr trouble is after clicking the NEW COURSE I am redirected to the same page without any changes in the database. No data is added to the database.

  • 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-05-30T05:17:29+00:00Added an answer on May 30, 2026 at 5:17 am

    You forgot to close the statement and the connection after use. Closing the connection will immediately commit the transaction. The normal JDBC idiom is that they are closed in finally block of the try block as where they’re created.

    You’ve by the way more serious issues with this JSP.

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

Sidebar

Related Questions

This has been asked a lot, but I'm still facing some issues with it.
I am working on a Google App Engine application, and have been facing some
We currently facing some stability issues with our develop web application product. This product
I have been facing a weird issue in a piece of code. void app_ErrDesc(char
We have been facing a small problem in MySQL procedure. We have placed some
We have been facing Out of Memory errors in our App server for sometime.
I have a public facing website that has been receiving a number of SQL
Have been struggling with Javascript closure for a while trying to wrap brain around
We have been using CruiseControl for quite a while with NUnit and NAnt. For
I'm playing with Remote Actors but I'm facing some difficulties. Consider this server: object

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.