Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

student registration page

  Asked By: Gin    Date: Sep 04    Category: Java    Views: 2404

I am now trying to create a student registration page
with servlet. But I could not figure out the

"When adding a course, the system checks whether the
class is in database already. If yes, the system gives
an error message".
I donot know how to make the system check the
any help is greatly appreciated.
the following is my current servlet:

import java.sql.*;
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class Student extends HttpServlet {
public void doPost (HttpServletRequest req,
HttpServletResponse res)
throws ServletException, IOException {

String studentid = req.getParameter("ID");
String coursenumber = req.getParameter("COURSENO");

PrintWriter out=res.getWriter();

Connection con=null;

try {

con = DriverManager.getConnection



Statement stmt = con.createStatement ();

stmt.executeUpdate("insert into registration values

out.println("Course added! Thanks for using this


catch (Exception e) {
try {

catch (SQLException ignored) {}
out.println("Process failed. Please contact technical

finally {
try {
if(con!=null) con.close();
catch (SQLException ignored) {}



2 Answers Found

Answer #1    Answered By: Dennis Hayes     Answered On: Sep 04

we have written an Internationlized Student
Registration System in J2EE you can have a copy of or
software with a very very low price if you want.

Answer #2    Answered By: Canan Kaya     Answered On: Sep 04

I think the
1. Class.forName("com.cloudscape.core.JDBCDriver");(not COM) (may be it is incorrect driver class  path or it is not added to your application server class path)

is incorrect.

I suggest you that use the connection  DataSource provided by most application Servers including WebLogic.It supporst ConnectionPooling and using connections by means of JNDI.It gives you beter performance!

Didn't find what you were looking for? Find more on student registration page Or get search suggestion and latest updates.