Home Answers Viewqa Java-Beginners Student Admission Form in Java

 
 


sushant
Student Admission Form in Java
1 Answer(s)      3 years and 3 months ago
Posted in : Java Beginners

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 Pages:
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
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
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
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
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
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
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
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
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 - 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
student registration example
student registration example  1.reg.jsp <%@ page language="java...; <form name="f1" > <form action="Servlet" method="get"> <...; 2,register.jsp <%@ page language="java" contentType="text/html
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
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
student weekly attandence genaration
student weekly attandence genaration  Hievery body iam doing student project in that i want student weekly ,yearly attendence generation report this project doing on struts frame front as java back end as oracle 10 g
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
student attendence report
student attendence report  Hi every body iam doing a school project iam using backend as oracle 10g front end as java . in my project generate student attendence daywise ,monthly ,halfyearly and yearly how i generate plz
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
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
important for all final years student
important for all final years student   i need a java program for my project, java program for getting path of the file in console while reading... letter content in from glassorry ,i need it in simple java code meanwhile using
important for all final years student
important for all final years student  i need a java program for my project, java program for getting path of the file in console while reading... it in simple java code meanwhile using some inbuilt function with control flow conditions
important for all final years student
important for all final years student  i need a java program for my project, java program for getting path of the file in console while reading... it in simple java code meanwhile using some inbuilt function with control flow conditions
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
using list iterator create student details - JavaMail
using list iterator create student details  write a java program to create student class with particulars like name, rno, marks,etc. and print them... which will describe you how to create Student class and add its properties
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
how to upload a student time table excelsheet
how to upload a student time table excelsheet   Hi good morning iam beginer iam doing project using struts frame work backend as 10g xe front end as java .in my student module i have time table so how to upload excelsheet
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
Form Validation
Form Validation  Java script validation for checking special characters and white spaces and give an alert.Please help me urgent Thanks in advance
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
login form
login form  sir my next form consists logout button when i click on it it showing login form but next form window is not closing but the components prepsent in that form are getting clearedup using frameobject.setVisible(false
Java Project Questions - Java Beginners
with Student Admission Form that form includes Course Name(in JComboBox). How i can...Java Project Questions  Hello sir ,I want Course Form in JAVA SWING that includes following contents- 1)Course Id -Numeric 2)Course NAME-TEXT 3
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: http://www.roseindia.net/jsp/user-search.shtml http
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
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
registration form
registration form  Hii.. I have to design one registration page in java that looks like REGISTER USERNAME (here i have to check whether username already exists in database) EMAIL ADDRESS (here i have to check whether email
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
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
program to create student report using java applet,read the input using text boxesand generate the grades..?
program to create student report using java applet,read the input using text boxesand generate the grades..?   sir plz give me java applet codes for above question
How to Create and display Reports in Java with Database connectivity - Java Beginners
How to Create and display Reports in Java with Database connectivity  Hello Sir , I have Created Student Admission Form with Swing and MS Access... of student id which is exists in the Current JTexfield /when I give Student Id

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.