Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Need help on a web application project

 
Nilesh Sanyal
Ranch Hand
Posts: 33
Eclipse IDE MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am designing a web page for users who are new to my website i.e, the Registration page and primarily I want that after clicking on submit button, the details of the users will be stored in the newuser named database.
I am using Oracle 11g express edition and JDBC thin driver for this purpose. But something went wrong, after clicking on Create account button it displays Exception=null. Please help

Codes for index.jsp page
================


Codes for conn.java file
===============


Codes for registrationServlet.java file
========================


Codes for web.xml file
==============
 
Tapas Chand
Ranch Hand
Posts: 613
9
BSD Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Empty catch block is one of the biggest mistakes a program can do in Java.
Put a stacktrace in catch block of conn class and check whether any exception while creating connection.
 
Tapas Chand
Ranch Hand
Posts: 613
9
BSD Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Few more things.
1. Put a stacktrace in servlet to find the exact cause of exception.
2. Do not make fields of a class public. They should be private...always.
3. Why are you importing Connection.conn in JSP? Are you using Conn class anywhere in the JSP?
4. In Java, package names should start with lower case and class names should start with upper case.
 
Roel De Nijs
Sheriff
Posts: 10763
148
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't agree more with Tapas' very useful cding tips! You should never have an empty catch block. Never!
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!