Student Admission Form in Java

Student Admission Form in Java

I want to store following Information into MS Access 2007 with JDBC.
1)Student PRN Number
2)Student Name
3)Date of admission
4)Fees
5)Payment Mode-with Combobox component(By Cheque,By Cash)
6)Education
7)Course
8)Admission Type(Regular,External)
when i click on submit button,I want to save this data into Access Databse.
plz Help Me Sir
View Answers

February 26, 2010 at 10:00 AM

Hi i produce sample application with access 2007 and i haven't done validation that part is for u.
I'm using netbeans 6.5.1 ide and access 2007 and jcalender 1.3.3 version
and odbc data sources .
1 .first create a table in access2007 with following fields
stu_prn | stu_name | stu_date_admit | stu_fees | stu_pay_mode | stu_course | stu_education | stu_admit_type

2 .set the primary key as stu_prn.

3.Then go to the StartMenu->control panel -> Administrative tools ->
Data sources and double click DataSources .
4. Then Slect systemdsn -> click add button -> from the wizard select
Microsoft Access Driver (*.mdb,*.accdb) then click finish.
Odbc Access setup dialog appers , give student for datasource field and from
Data base section (below) click on select button select the your database
from the file browser diaog and click ok . Again click ok.

Here Is the dbclass code.
----------------------------------------------
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package pk;

import java.sql.*;

/**
*
* @author samith
*/
public class AccessConnection {

static String uri = "jdbc:odbc:student";

private Connection getAccessConnection() {
Connection con = null;
try {
con = DriverManager.getConnection(uri, "", "");
return con;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}

public int insertAdmissinData(String prn, String name, String date, double fees, String pmode, String course, String edu, String admitty) throws SQLException {
Connection con = null;
Statement st = null;
String sql = "insert into Admission values ('" + prn + "','" + name + "','" + date + "'," + fees + ",'" + pmode + "','" + course + "','" + edu + "','" + admitty + "')";
try {
con = getAccessConnection();
st = con.createStatement();
int result = st.executeUpdate(sql);
return 0;
} catch (Exception e) {
e.printStackTrace();
return -1;
} finally {
if (con != null) {
con.close();
}
if (st != null) {
st.close();
}
}
}
}

---------------------------------
Here is code for jframe
--------------------------------
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/*
* AdmissionFrm.java
*
* Created on Feb 26, 2010, 8:39:08 AM
*/
package pk;

import javax.swing.JOptionPane;

/**
*
* @author samith
*/
public class AdmissionFrm extends javax.swing.JFrame {

/** Creates new form AdmissionFrm */
public AdmissionFrm() {
initComponents();
}

/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {

jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
txtPrn = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
txtName = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
txtFees = new javax.swing.JTextField();
jLabel5 = new javax.swing.JLabel();
dateAdmitdate = new org.gui.JCalendarCombo();
jLabel6 = new javax.swing.JLabel();
cmbPaymentMode = new javax.swing.JComboBox();
jLabel7 = new javax.swing.JLabel();
txtEducation = new javax.swing.JTextField();
jLabel8 = new javax.swing.JLabel();
txtCourse = new javax.swing.JTextField();
jLabel9 = new javax.swing.JLabel();
txtAdmissionType = new javax.swing.JTextField();
btnSave = new javax.swing.JButton();
btnClear = new javax.swing.JButton();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel1.setText("Student Admission Application");

jLabel2.setText(" Prn:");

jLabel3.setText("Name:");

jLabel4.setText("Fees :");

jLabel5.setText("Date :");

jLabel6.setText("Payment Mode:");

cmbPaymentMode.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Cheque", "Cash" }));

jLabel7.setText("Educataion:");

jLabel8.setText("Course :");

jLabel9.setText("Admission Type:");

btnSave.setText("Save");
btnSave.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnSaveActionPerformed(evt);
}
});

btnClear.setText("Reset");
btnClear.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnClearActionPerformed(evt);
}
});

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel3)
.addComponent(jLabel2)
.addComponent(jLabel4)
.addComponent(jLabel5)
.addComponent(jLabel6)
.addComponent(jLabel7)
.addComponent(jLabel8))
.addComponent(jLabel9))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(txtAdmissionType, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 179, Short.MAX_VALUE)
.addComponent(txtPrn, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 179, Short.MAX_VALUE)
.addComponent(txtName, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 179, Short.MAX_VALUE)
.addComponent(txtFees, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 179, Short.MAX_VALUE)
.addComponent(dateAdmitdate, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 179, Short.MAX_VALUE)
.addComponent(cmbPaymentMode, javax.swing.GroupLayout.Alignment.LEADING, 0, 179, Short.MAX_VALUE)
.addComponent(txtEducation, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 179, Short.MAX_VALUE)
.addComponent(txtCourse, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 179, Short.MAX_VALUE)))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(btnSave)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnClear)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
.addGap(89, 89, 89))
.addGroup(layout.createSequentialGroup()
.addGap(21, 21, 21)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 269, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(66, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(txtPrn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(txtName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4)
.addComponent(txtFees, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel5)
.addComponent(dateAdmitdate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel6)
.addComponent(cmbPaymentMode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel7)
.addComponent(txtEducation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel8)
.addComponent(txtCourse, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel9)
.addComponent(txtAdmissionType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 32, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnClear)
.addComponent(btnSave))
.addGap(20, 20, 20))
);

pack();
}// </editor-fold>
private void clear(){
txtAdmissionType.setText("");
txtCourse.setText("");
txtEducation.setText("");
txtFees.setText("");
txtName.setText("");
txtPrn.setText("");
}
private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {
try {
String prn = txtPrn.getText();
String name = txtName.getText();
String date = dateAdmitdate.getSelectedDate();
double fees = Double.parseDouble(txtFees.getText());
String pmode = cmbPaymentMode.getSelectedItem().toString();
String course = txtCourse.getText();
String edu = txtEducation.getText();
String admitty = txtAdmissionType.getText();
AccessConnection ac=new AccessConnection();
int result =ac.insertAdmissinData(prn, name, date, fees, pmode, course, edu, admitty);
clear();
if(result==0){
JOptionPane.showMessageDialog(null, "Succesfully Saved.","Information",JOptionPane.INFORMATION_MESSAGE);

}else{
JOptionPane.showMessageDialog(null, "Errors Occured.","Error",JOptionPane.ERROR_MESSAGE);
}

} catch (Exception e) {
e.printStackTrace();
}
}

private void btnClearActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
clear();
}

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {
new AdmissionFrm().setVisible(true);
}
});
}

// Variables declaration - do not modify
private javax.swing.JButton btnClear;
private javax.swing.JButton btnSave;
private javax.swing.JComboBox cmbPaymentMode;
private org.gui.JCalendarCombo dateAdmitdate;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JTextField txtAdmissionType;
private javax.swing.JTextField txtCourse;
private javax.swing.JTextField txtEducation;
private javax.swing.JTextField txtFees;
private javax.swing.JTextField txtName;
private javax.swing.JTextField txtPrn;
// End of variables declaration
}

-----------------------------------
download jcalender 1.3.3 jar from
http://www.toedter.com/en/jcalendar/index.html

when you create project in netbeans add those jars to your project.
Best Regards.









Related Tutorials/Questions & Answers:
Student Admission Form in Java - Java Beginners
Student Admission Form in Java  I want to store following Information into MS Access 2007 with JDBC. 1)Student PRN Number 2)Student Name 3)Date...(javax.swing.SwingConstants.CENTER); jLabel1.setText("Student Admission
College Student Admission System Project in Java
College Student Admission System Project in Java   Front End -JAVA Back End - MS Access Hello Sir, I want College Student Admission Project in Java with Source code, that includes Following Forms 1) Student Admission based
Advertisements
student admission system project
Student Admission Project in Java with Source code, that includes Following Forms 1) Student Admission based,its urgent sir...student admission system project  College Student Admission System
project for Student Admission System
project for Student Admission System  I want Mini Java Project for Student Admission System. actually i want 2 know how 2 start this...please show me my way
college student admission
college student admission  Front End -JAVA Back End - MS Access Hello Sir, I want College Student Admission Project in Java with Source code, that includes Following Forms 1) Student Admission based on Enterance Exam Marks
College Student Admission System Project in Java - Java Beginners
College Student Admission System Project in Java   Front End -JAVA Back End - MS Access Hello Sir, I want College Student Admission Project in Java with Source code, that includes Following Forms 1) Student Admission based
College Student Admission System Project in Java - Java Beginners
College Student Admission System Project in Java    Front End -JAVA Back End - MS Access Hello Sir, I want College Student Admission Project in Java with Source code, that includes Following Forms 1) Student Admission based
College Student Admission System Project in Java - Development process
College Student Admission System Project in Java   Front End -JAVA Back End - MS Access Hello Sir, I want College Student Admission Project in Java with Source code, that includes Following Forms 1) Student Admission
Tutorial college Student Admission System
Tutorial college Student Admission System  I want PHP Project for Student Admission System. actually i want 2 know how 2 start this...please show me my way..... please send me synopsis
I want Mini Java Project for Student Admission System. actually i want 2 know how 2 start this...please show me my way.....
I want Mini Java Project for Student Admission System. actually i want 2 know how 2 start this...please show me my way.....  I want Mini Java Project for Student Admission System. actually i want 2 know how 2 start this...please
Student Information System in Java - Java Beginners
Student Information System in Java  Hello Sir, I want Mini Java Project for Student Admission System.  Hi Friend, Can you provide us details regarding your project like student admission form, faculty information
Admission Validation - Java Beginners
("Student Admission Form"); f.getContentPane().setLayout(null); JLabel lbl1 = new...Admission Validation  Hello sir I have Designed Student Admission Form ,I want to Display Admission Status on Form that is Availbal Seats and Fillup
Java Project for College Admission System - Java Beginners
Java Project for College Admission System  I want Project for Student Information System in Java Back end-MS Access plz Give Me source code or website to download it. plz Help Me
Java Project for College Admission System - Java Beginners
Java Project for College Admission System  Hello Sir I urgently wants College Admission Project in Java,with Back End Microsft Access 2007 ,sir plz... be in each form and little bit description more   If you urgent visit
how to validate e,ail id and phne number in student form
how to validate e,ail id and phne number in student form  how to validate e,ail id and phne number in student form   Hi Friend, Visit Here Thanks
how to validate e,ail id and phne number in student form
how to validate e,ail id and phne number in student form  how to validate e,ail id and phne number in student form   Hi Friend, Visit Here Thanks
html code for student registration form
html code for student registration form Here is an example of html code for student registration form. In this example, we have displayed many text fields... in student registration form. If you will not enter value in text field than an error
Student - Java Beginners
Student  Create a class named Student which has data fields of student metric number, mark for the quizzes (15% from the total mark), lab assignments... including the total marks and the grade in a tabular form.  Hi Friend
how to validate e,ail id and phne number in student form
how to validate e,ail id and phne number in student form  how to validate e,ail id and phne number in student form   Hi Friend, Try... { return true; } } </script> <form id="form" method="post" onsubmit
How to Create Student Registration Form with HTML Code?
How to Create Student Registration Form with HTML Code? At present, the concept of online student registration form has emerged as a great relief... will learn to create a student registration form using html code in easy steps
Admission Procedure
the admission form that can be get through clicking on the new user option... Admission Procedure       Admission procedure is very simple due to on-line admission facility. Just
student
student  There is only 1 player. Use JAVA Random toolkit to generate random number between 1 to 10. Once user has entered in a number, checked... link: Java Guess Number
sorting student record - Java Beginners
sorting student record  Program in java for inserting, recording, deleting, editing and searching student details   can u explain about recording ? u want to store value in database or in file or opertinng run time
Print Form - Java Beginners
Print Form  Hello Sir I have Created Admission Form when user fills... want to get Print of that forms Contents,How I can Do it with JAVA SWING,plz...://www.roseindia.net/java/example/java/swing/Print.shtml Hope that it will be helpful
Java GUI to build a Student Registration Program
Java GUI to build a Student Registration Program   Write a program... if the student is successfully registered for the course. Graduate students can... should graphically display a sorted list of registered courses for a student
project on admission procedure
project on admission procedure  how to get basic idea about this project...what are requirements that we need before doing this project??and will the length of the code be more
Student average
Student average  you are an academic scholar.one requirement to maintain this status is to maintain an average not below 1.8. write a java program that reads student's number of subject taken, the final grade of each subject
Student Marks
Student Marks  Hi everyone I have to do this java assignment... programming grades of 8 IT students. Randomly create student numbers for each... in an array. Addresses of Students and store them in array. Previous Grade for student
Student database
Student database  Create a class Student with Name, Gender, and Date of Birth and Input Student and print as ?Dear Mr/Mrs Name, your Age is 99 Years?. Mr/Mrs - only one should be displayed based on their age and Gender
student details
student details  hi sir/madam i have a doubt in PHP how to insert student details using mysql with php..   Have a look at the following link: PHP Mysql insert
student details
student details  create an application for details of 1st to 5th standard students by using loops and scanner
form to java script conversion
form to java script conversion  I am using a form one more form cotain a piece of code . how to convert it to java script to function it properly? code is shown below <form action="http://www.google.com" id="cse-search
student database
student database  student records such as fees-school fees, dob,age,if any due.the record stored should be like this record,name,age,dob,fee list or any dues of the student record1 isha 15 20jan record2 spandana 14 4feb record3
How to create a Student data base using Linked List in java
How to create a Student data base using Linked List in java  I want a program by using linked list in java. The data stored must be as Records name age dob Record1 bindu
student info
student info  code of insert,delete,update,view,search of student information using jsp and servelts   Hi Friend, Please visit the following links:ADS_TO_REPLACE_1 http://www.roseindia.net/jsp/user-search.shtml http
form values in java script - Struts
form values in java script  how to get form values in java script functions with struts1.1
How to design a form using java?
How to design a form using java?  Please help in designing of form using java for my project
Without Using Form in Java Script
Without Using Form in Java Script  HOw to Reset the data in javascript without using form tag
java login form using netbeans
java login form using netbeans  how to connect an access database to a login form using netbeans
Student
student
Student
mdi form - Java Beginners
mdi form  Can I add JDesktopPane to panel? i wanna to have 2 panel in may form .......and the second panel i want to make mdi form. thanx
Student Marks
Student Marks  Create a simple application which can calculate 5 marks entered by user and find the grade. Create a simple application which can calculate 5 marks entered by user and find the grade. You must display the grade
html form - Java Beginners
html form  Hi, I wnt to design a form with more than one action in submit button.thanks. regards, sakthi  Hi friend, You specify your main requirement of form with more then one action. Thanks
HTML form - Java Beginners
(form1 and form 2)with several fields in html. When i click the submit button, it validates all fields then moves to form2. i have a problem with form navigation. i want jsp code for form navication. thanks, regards. sakthi  Hi
form
form   Can I prevent a form from being submitted again
Design of java form
Design of java form  sir can u plz help me i want to design a interactive java form mins some thing diffrent in form is it possible in java if yes then help me thank u   Hi Friend, Yes, you can using java swing
ModuleNotFoundError: No module named 'odoo9-addon-openeducat-admission'
ModuleNotFoundError: No module named 'odoo9-addon-openeducat-admission' ...: ModuleNotFoundError: No module named 'odoo9-addon-openeducat-admission' How to remove the ModuleNotFoundError: No module named 'odoo9-addon-openeducat-admission'
ModuleNotFoundError: No module named 'odoo9-addon-openeducat-l10n-in-admission'
ModuleNotFoundError: No module named 'odoo9-addon-openeducat-l10n-in-admission...: ModuleNotFoundError: No module named 'odoo9-addon-openeducat-l10n-in-admission' How...-openeducat-l10n-in-admission' error? Thanks   Hi, In your python

Ads