SlideShare a Scribd company logo
Net Beans Codes for Student Portal
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication3;
import java.sql.*;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.*;
import javax.swing.JOptionPane;
/**
*
* @author ARTIFICIAL
*/
public class StudentDetailsForm extends javax.swing.JFrame {
/**
* Creates new form StudentDetailsForm
*/
public StudentDetailsForm() throws Exception {
Class.forName("oracle.jdbc.driver.OracleDriver");
con =
DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orc
l", "system", "password");
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">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jsname = new javax.swing.JTextField();
jfname = new javax.swing.JTextField();
jmname = new javax.swing.JTextField();
jsession = new javax.swing.JTextField();
jmobile = new javax.swing.JTextField();
jemail = new javax.swing.JTextField();
jScrollPane1 = new javax.swing.JScrollPane();
jadd = new javax.swing.JTextArea();
jbrefresh = new javax.swing.JButton();
jbsubmit = new javax.swing.JButton();
jbranch = new javax.swing.JComboBox();
jdob = new javax.swing.JTextField();
jsid = new javax.swing.JTextField();
jLabel10 = new javax.swing.JLabel();
jrsid = new javax.swing.JRadioButton();
jrsname = new javax.swing.JRadioButton();
jrfname = new javax.swing.JRadioButton();
jrmname = new javax.swing.JRadioButton();
jrdob = new javax.swing.JRadioButton();
jrsession = new javax.swing.JRadioButton();
jrmobile = new javax.swing.JRadioButton();
jremail = new javax.swing.JRadioButton();
jrsadd = new javax.swing.JRadioButton();
jbStuentInfo = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_C
LOSE);
setTitle("STUDENT DETAILS FORM");
jLabel1.setText("Student Name");
jLabel2.setText("Father's Name");
jLabel3.setText("Mother's Name");
jLabel4.setText("Session");
jLabel5.setText("Address");
jLabel6.setText("Mobile no");
jLabel7.setText("Email ID");
jLabel8.setText("Branch");
jLabel9.setText("Date of Birth(dd-mm-yy)");
jsname.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jsnameActionPerformed(evt);
}
});
jfname.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jfnameActionPerformed(evt);
}
});
jmname.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt) {
jmnameActionPerformed(evt);
}
});
jsession.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jsessionActionPerformed(evt);
}
});
jmobile.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jmobileActionPerformed(evt);
}
});
jemail.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jemailActionPerformed(evt);
}
});
jadd.setColumns(20);
jadd.setRows(5);
jScrollPane1.setViewportView(jadd);
jbrefresh.setText("Refresh");
jbrefresh.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt) {
jbrefreshActionPerformed(evt);
}
});
jbsubmit.setText("Submit");
jbsubmit.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt) {
jbsubmitActionPerformed(evt);
}
});
jbranch.setModel(new
javax.swing.DefaultComboBoxModel(new String[] { "CIVIL
ENGINEERING", "MECHANICAL ENGINEERING", "ELECTRICAL
ENGINEERING", "ELECTRONICS AND COMMUNICATION
ENGINEERING", "COMPUTER SCIENCE AND ENGINEERING" }));
jdob.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jdobActionPerformed(evt);
}
});
jsid.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jsidActionPerformed(evt);
}
});
jLabel10.setText("Student ID");
jrsid.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jrsidActionPerformed(evt);
}
});
jrsname.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt) {
jrsnameActionPerformed(evt);
}
});
jrfname.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jrfnameActionPerformed(evt);
}
});
jrmname.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt) {
jrmnameActionPerformed(evt);
}
});
jrdob.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jrdobActionPerformed(evt);
}
});
jrsession.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt) {
jrsessionActionPerformed(evt);
}
});
jrmobile.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt) {
jrmobileActionPerformed(evt);
}
});
jremail.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jremailActionPerformed(evt);
}
});
jrsadd.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jrsaddActionPerformed(evt);
}
});
jbStuentInfo.setText("Student Info");
jbStuentInfo.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jbStuentInfoActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new
javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEA
DING)
.addGroup(layout.createSequentialGroup()
.addGap(26, 26, 26)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig
nment.TRAILING, false)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2,
javax.swing.GroupLayout.PREFERRED_SIZE, 119,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jfname,
javax.swing.GroupLayout.PREFERRED_SIZE, 166,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel3,
javax.swing.GroupLayout.PREFERRED_SIZE, 119,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jmname,
javax.swing.GroupLayout.PREFERRED_SIZE, 166,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel6,
javax.swing.GroupLayout.PREFERRED_SIZE, 119,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jmobile,
javax.swing.GroupLayout.PREFERRED_SIZE, 166,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel7,
javax.swing.GroupLayout.PREFERRED_SIZE, 119,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jemail,
javax.swing.GroupLayout.PREFERRED_SIZE, 166,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel5,
javax.swing.GroupLayout.PREFERRED_SIZE, 119,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(33, 33, 33)
.addComponent(jScrollPane1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig
nment.LEADING)
.addComponent(jLabel4,
javax.swing.GroupLayout.PREFERRED_SIZE, 119,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel8,
javax.swing.GroupLayout.PREFERRED_SIZE, 119,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel9,
javax.swing.GroupLayout.PREFERRED_SIZE, 119,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig
nment.LEADING, false)
.addComponent(jsession)
.addComponent(jbranch, 0, 1, Short.MAX_VALUE)
.addComponent(jdob,
javax.swing.GroupLayout.DEFAULT_SIZE, 166, Short.MAX_VALUE)))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig
nment.LEADING, false)
.addComponent(jLabel1,
javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE)
.addComponent(jLabel10,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig
nment.LEADING, false)
.addComponent(jsname)
.addComponent(jsid,
javax.swing.GroupLayout.DEFAULT_SIZE, 166, Short.MAX_VALUE)))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING,
layout.createSequentialGroup()
.addComponent(jbrefresh)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jbsubmit)
.addGap(41, 41, 41)
.addComponent(jbStuentInfo)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig
nment.LEADING)
.addComponent(jrsid)
.addComponent(jrsname)
.addComponent(jrfname)
.addComponent(jrmname)
.addComponent(jrdob)
.addComponent(jrsession)
.addComponent(jrmobile)
.addComponent(jremail)
.addComponent(jrsadd))
.addGap(0, 25, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEA
DING)
.addGroup(layout.createSequentialGroup()
.addGap(13, 13, 13)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig
nment.BASELINE)
.addComponent(jsid,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel10)
.addComponent(jrsid))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig
nment.BASELINE)
.addComponent(jLabel1)
.addComponent(jsname,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jrsname))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig
nment.BASELINE)
.addComponent(jfname,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel2)
.addComponent(jrfname))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig
nment.BASELINE)
.addComponent(jLabel3)
.addComponent(jmname,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jrmname))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig
nment.BASELINE)
.addComponent(jLabel9)
.addComponent(jdob,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jrdob))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig
nment.BASELINE)
.addComponent(jLabel8)
.addComponent(jbranch,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig
nment.BASELINE)
.addComponent(jLabel4)
.addComponent(jsession,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jrsession))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig
nment.BASELINE)
.addComponent(jLabel6)
.addComponent(jmobile,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jrmobile))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig
nment.BASELINE)
.addComponent(jLabel7)
.addComponent(jemail,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jremail))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig
nment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel5)
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig
nment.LEADING)
.addComponent(jrsadd)
.addComponent(jScrollPane1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGap(28, 28, 28)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig
nment.BASELINE)
.addComponent(jbsubmit)
.addComponent(jbrefresh)
.addComponent(jbStuentInfo)))
);
jsid.getAccessibleContext().setAccessibleName("jsid");
jsid.getAccessibleContext().setAccessibleDescription("");
jsid.getAccessibleContext().setAccessibleParent(jsid);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jsnameActionPerformed(java.awt.event.ActionEvent
evt) {//GEN-FIRST:event_jsnameActionPerformed
}//GEN-LAST:event_jsnameActionPerformed
private void jfnameActionPerformed(java.awt.event.ActionEvent
evt) {//GEN-FIRST:event_jfnameActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jfnameActionPerformed
private void jmnameActionPerformed(java.awt.event.ActionEvent
evt) {//GEN-FIRST:event_jmnameActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jmnameActionPerformed
private void jsessionActionPerformed(java.awt.event.ActionEvent
evt) {//GEN-FIRST:event_jsessionActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jsessionActionPerformed
private void jmobileActionPerformed(java.awt.event.ActionEvent
evt) {//GEN-FIRST:event_jmobileActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jmobileActionPerformed
private void jemailActionPerformed(java.awt.event.ActionEvent
evt) {//GEN-FIRST:event_jemailActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jemailActionPerformed
private void jbsubmitActionPerformed(java.awt.event.ActionEvent
evt) {//GEN-FIRST:event_jbsubmitActionPerformed
try {if(evt.getSource()==jbsubmit){
int s9=Integer.parseInt(jsid.getText());
s=jsname.getText();
s1=jfname.getText();
s2=jmname.getText();
//------------date processing starts-------------
s3=jdob.getText();
SimpleDateFormat sdf1=new SimpleDateFormat("dd-MM-
yy");
java.util.Date udob=sdf1.parse(s3);
java.sql.Date sqdob=new java.sql.Date(udob.getTime());
//------------date processing ends----------------
s4=(String)jbranch.getSelectedItem();
s5=jsession.getText();
long s6=Long.parseLong(jmobile.getText());
s7=jemail.getText();
s8=jadd.getText();
qry="insert into studentdetails values(?,?,?,?,?,?,?,?,?,?)" ;
ps=con.prepareStatement(qry);
//set values on index in table
ps.setInt(1, s9);
ps.setString(2,s);
ps.setString(3,s1);
ps.setString(4,s2);
ps.setDate(5,sqdob);
ps.setString(6,s4);
ps.setString(7,s5);
ps.setLong(8,s6);
ps.setString(9,s7);
ps.setString(10,s8);
//executing update
ps.executeUpdate();
System.out.println("Data Inserted");
ps.close();
con.close();
}
} catch (ParseException | SQLException ex) {
Logger.getLogger(StudentDetailsForm.class.getName()).log(Level.SEV
ERE, null, ex);
}
}//GEN-LAST:event_jbsubmitActionPerformed
private void jbrefreshActionPerformed(java.awt.event.ActionEvent
evt) {//GEN-FIRST:event_jbrefreshActionPerformed
if(evt.getSource()==jbrefresh){
jsname.setText("");
jfname.setText("");
jmname.setText("");
jdob.setText("");
jsession.setText("");
jmobile.setText("");
jemail.setText("");
jadd.setText("");
jsid.setText("");
}
}//GEN-LAST:event_jbrefreshActionPerformed
private void jdobActionPerformed(java.awt.event.ActionEvent evt)
{//GEN-FIRST:event_jdobActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jdobActionPerformed
private void jsidActionPerformed(java.awt.event.ActionEvent evt)
{//GEN-FIRST:event_jsidActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jsidActionPerformed
private void jrsidActionPerformed(java.awt.event.ActionEvent evt)
{//GEN-FIRST:event_jrsidActionPerformed
if(evt.getSource()==jrsid){
jsid.setText("");
}
}//GEN-LAST:event_jrsidActionPerformed
private void jrsnameActionPerformed(java.awt.event.ActionEvent
evt) {//GEN-FIRST:event_jrsnameActionPerformed
if(evt.getSource()==jrsname){
jsname.setText("");
}
}//GEN-LAST:event_jrsnameActionPerformed
private void jrfnameActionPerformed(java.awt.event.ActionEvent
evt) {//GEN-FIRST:event_jrfnameActionPerformed
if(evt.getSource()==jrfname){
jfname.setText("");
}
}//GEN-LAST:event_jrfnameActionPerformed
private void jrmnameActionPerformed(java.awt.event.ActionEvent
evt) {//GEN-FIRST:event_jrmnameActionPerformed
if(evt.getSource()==jrmname){
jmname.setText("");
}
}//GEN-LAST:event_jrmnameActionPerformed
private void jrdobActionPerformed(java.awt.event.ActionEvent
evt) {//GEN-FIRST:event_jrdobActionPerformed
if(evt.getSource()==jrdob){
jdob.setText("");
}
}//GEN-LAST:event_jrdobActionPerformed
private void jrsessionActionPerformed(java.awt.event.ActionEvent
evt) {//GEN-FIRST:event_jrsessionActionPerformed
if(evt.getSource()==jrsession){
jsession.setText("");
}
}//GEN-LAST:event_jrsessionActionPerformed
private void jrmobileActionPerformed(java.awt.event.ActionEvent
evt) {//GEN-FIRST:event_jrmobileActionPerformed
if(evt.getSource()==jrmobile){
jmobile.setText("");
}
}//GEN-LAST:event_jrmobileActionPerformed
private void jremailActionPerformed(java.awt.event.ActionEvent
evt) {//GEN-FIRST:event_jremailActionPerformed
if(evt.getSource()==jremail){
jemail.setText("");
}
}//GEN-LAST:event_jremailActionPerformed
private void jrsaddActionPerformed(java.awt.event.ActionEvent
evt) {//GEN-FIRST:event_jrsaddActionPerformed
if(evt.getSource()==jrsadd){
jadd.setText("");
}
}//GEN-LAST:event_jrsaddActionPerformed
private void
jbStuentInfoActionPerformed(java.awt.event.ActionEvent evt)
{//GEN-FIRST:event_jbStuentInfoActionPerformed
if(evt.getSource()==jbStuentInfo){
try {
String inputValue
=JOptionPane.showInputDialog(this,"Please Enter Valid Student ID");
qry="select * from studentdetails";
ps=con.prepareStatement(qry);
rs=ps.executeQuery();
//process ResultSet obj
while(rs.next()){
if (inputValue.equals((rs.getString(1)))){
//getting the field values
jsid.setText(rs.getString(1));
jsname.setText(rs.getString(2));
jfname.setText(rs.getString(3));
jmname.setText(rs.getString(4));
//dob retrieving codings begin...
java.sql.Date sqdob=rs.getDate(5);
//dob retrieving codings ends here..
jbranch.setSelectedItem(rs.getString(6));
jsession.setText(rs.getString(7));
jmobile.setText(rs.getString(8));
jemail.setText(rs.getString(9));
jadd.setText(rs.getString(10));
}//inner if
} //inner while
}//try
catch (SQLException ex)
{
Logger.getLogger(StudentDetailsForm.class.getName()).log(Level.SEV
ERE, null, ex);
}
}//outer if
}//GEN-LAST:event_jbStuentInfoActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/*
* Set the Nimbus look and feel
*/
//<editor-fold defaultstate="collapsed" desc=" Look and feel
setting code (optional) ">
/*
* If Nimbus (introduced in Java SE 6) is not available, stay with
the
* default look and feel. For details see
*
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/pla
f.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(StudentDetailsForm.class.getNam
e()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(StudentDetailsForm.class.getNam
e()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(StudentDetailsForm.class.getNam
e()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(StudentDetailsForm.class.getNam
e()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/*
* Create and display the form
*/
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
try {
new StudentDetailsForm().setVisible(true);
} catch (Exception ex) {
Logger.getLogger(StudentDetailsForm.class.getName()).log(Level.SEV
ERE, null, ex);
}
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
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.JScrollPane jScrollPane1;
private javax.swing.JTextArea jadd;
private javax.swing.JButton jbStuentInfo;
private javax.swing.JComboBox jbranch;
private javax.swing.JButton jbrefresh;
private javax.swing.JButton jbsubmit;
private javax.swing.JTextField jdob;
private javax.swing.JTextField jemail;
private javax.swing.JTextField jfname;
private javax.swing.JTextField jmname;
private javax.swing.JTextField jmobile;
private javax.swing.JRadioButton jrdob;
private javax.swing.JRadioButton jremail;
private javax.swing.JRadioButton jrfname;
private javax.swing.JRadioButton jrmname;
private javax.swing.JRadioButton jrmobile;
private javax.swing.JRadioButton jrsadd;
private javax.swing.JRadioButton jrsession;
private javax.swing.JRadioButton jrsid;
private javax.swing.JRadioButton jrsname;
private javax.swing.JTextField jsession;
private javax.swing.JTextField jsid;
private javax.swing.JTextField jsname;
// End of variables declaration//GEN-END:variables
private Connection con;
private Statement st;
private ResultSet rs,rs1;
private String s,s1,s2,s3,s4,s5,s7,s8,qry;
private PreparedStatement ps;
}

More Related Content

What's hot

Chapter 10.2
Chapter 10.2Chapter 10.2
Chapter 10.2sotlsoc
 
Exercícios Netbeans - Vera Cymbron
Exercícios Netbeans - Vera CymbronExercícios Netbeans - Vera Cymbron
Exercícios Netbeans - Vera Cymbroncymbron
 
Manual tecnico
Manual tecnicoManual tecnico
Manual tecnico481200601
 
iOS Talks 6: Unit Testing
iOS Talks 6: Unit TestingiOS Talks 6: Unit Testing
iOS Talks 6: Unit Testing
Marin Benčević
 
Practical JavaScript Programming - Session 4/8
Practical JavaScript Programming - Session 4/8Practical JavaScript Programming - Session 4/8
Practical JavaScript Programming - Session 4/8
Wilson Su
 
Ip project
Ip projectIp project
Ip project
Anurag Surya
 
Ecom lec4 fall16_jpa
Ecom lec4 fall16_jpaEcom lec4 fall16_jpa
Ecom lec4 fall16_jpa
Zainab Khallouf
 
Removing structural duplication
Removing structural duplicationRemoving structural duplication
Removing structural duplication
Alexandru Bolboaca
 
Practical JavaScript Programming - Session 1/8
Practical JavaScript Programming - Session 1/8Practical JavaScript Programming - Session 1/8
Practical JavaScript Programming - Session 1/8
Wilson Su
 
JavaScript Proven Practises
JavaScript Proven PractisesJavaScript Proven Practises
JavaScript Proven PractisesRobert MacLean
 
Productive Debugging
Productive DebuggingProductive Debugging
Productive Debugging
iThink
 
Android Jetpack: ViewModel and Testing
Android Jetpack: ViewModel and TestingAndroid Jetpack: ViewModel and Testing
Android Jetpack: ViewModel and Testing
Yongjun Kim
 
Beautiful java script
Beautiful java scriptBeautiful java script
Beautiful java script
Ürgo Ringo
 
Settings
SettingsSettings
Settings
yito24
 
Spring frame work
Spring frame workSpring frame work
Spring frame work
husnara mohammad
 
Дмитрий Контрерас «Back to the future: the evolution of the Java Type System»
Дмитрий Контрерас «Back to the future: the evolution of the Java Type System»Дмитрий Контрерас «Back to the future: the evolution of the Java Type System»
Дмитрий Контрерас «Back to the future: the evolution of the Java Type System»
Anna Shymchenko
 
Accessing Data Through Hibernate; What DBAs Should Tell Developers and Vice V...
Accessing Data Through Hibernate; What DBAs Should Tell Developers and Vice V...Accessing Data Through Hibernate; What DBAs Should Tell Developers and Vice V...
Accessing Data Through Hibernate; What DBAs Should Tell Developers and Vice V...
Marco Tusa
 
UI testing in Xcode 7
UI testing in Xcode 7UI testing in Xcode 7
UI testing in Xcode 7
Dominique Stranz
 
Don't Make Android Bad... Again
Don't Make Android Bad... AgainDon't Make Android Bad... Again
Don't Make Android Bad... Again
Pedro Vicente
 

What's hot (19)

Chapter 10.2
Chapter 10.2Chapter 10.2
Chapter 10.2
 
Exercícios Netbeans - Vera Cymbron
Exercícios Netbeans - Vera CymbronExercícios Netbeans - Vera Cymbron
Exercícios Netbeans - Vera Cymbron
 
Manual tecnico
Manual tecnicoManual tecnico
Manual tecnico
 
iOS Talks 6: Unit Testing
iOS Talks 6: Unit TestingiOS Talks 6: Unit Testing
iOS Talks 6: Unit Testing
 
Practical JavaScript Programming - Session 4/8
Practical JavaScript Programming - Session 4/8Practical JavaScript Programming - Session 4/8
Practical JavaScript Programming - Session 4/8
 
Ip project
Ip projectIp project
Ip project
 
Ecom lec4 fall16_jpa
Ecom lec4 fall16_jpaEcom lec4 fall16_jpa
Ecom lec4 fall16_jpa
 
Removing structural duplication
Removing structural duplicationRemoving structural duplication
Removing structural duplication
 
Practical JavaScript Programming - Session 1/8
Practical JavaScript Programming - Session 1/8Practical JavaScript Programming - Session 1/8
Practical JavaScript Programming - Session 1/8
 
JavaScript Proven Practises
JavaScript Proven PractisesJavaScript Proven Practises
JavaScript Proven Practises
 
Productive Debugging
Productive DebuggingProductive Debugging
Productive Debugging
 
Android Jetpack: ViewModel and Testing
Android Jetpack: ViewModel and TestingAndroid Jetpack: ViewModel and Testing
Android Jetpack: ViewModel and Testing
 
Beautiful java script
Beautiful java scriptBeautiful java script
Beautiful java script
 
Settings
SettingsSettings
Settings
 
Spring frame work
Spring frame workSpring frame work
Spring frame work
 
Дмитрий Контрерас «Back to the future: the evolution of the Java Type System»
Дмитрий Контрерас «Back to the future: the evolution of the Java Type System»Дмитрий Контрерас «Back to the future: the evolution of the Java Type System»
Дмитрий Контрерас «Back to the future: the evolution of the Java Type System»
 
Accessing Data Through Hibernate; What DBAs Should Tell Developers and Vice V...
Accessing Data Through Hibernate; What DBAs Should Tell Developers and Vice V...Accessing Data Through Hibernate; What DBAs Should Tell Developers and Vice V...
Accessing Data Through Hibernate; What DBAs Should Tell Developers and Vice V...
 
UI testing in Xcode 7
UI testing in Xcode 7UI testing in Xcode 7
UI testing in Xcode 7
 
Don't Make Android Bad... Again
Don't Make Android Bad... AgainDon't Make Android Bad... Again
Don't Make Android Bad... Again
 

Viewers also liked

الإستئناف بداية نهاية الشلل التاريخي - أبو يعرب المرزوقي
الإستئناف   بداية نهاية الشلل التاريخي - أبو يعرب المرزوقيالإستئناف   بداية نهاية الشلل التاريخي - أبو يعرب المرزوقي
الإستئناف بداية نهاية الشلل التاريخي - أبو يعرب المرزوقي
أبو يعرب المرزوقي
 
System obiegu korespondencji
System obiegu korespondencjiSystem obiegu korespondencji
System obiegu korespondencji
Intratic
 
الاستئناف بداية نهاية الشلل التاريخي - أبو يعرب المرزوقي
الاستئناف   بداية نهاية الشلل التاريخي - أبو يعرب المرزوقيالاستئناف   بداية نهاية الشلل التاريخي - أبو يعرب المرزوقي
الاستئناف بداية نهاية الشلل التاريخي - أبو يعرب المرزوقي
أبو يعرب المرزوقي
 
Online Form Submission App
Online Form Submission AppOnline Form Submission App
Online Form Submission AppPeeyush Ranjan
 
Photo Insert and Retrieve App
Photo Insert and Retrieve AppPhoto Insert and Retrieve App
Photo Insert and Retrieve AppPeeyush Ranjan
 
Transaction Management Tool
Transaction Management ToolTransaction Management Tool
Transaction Management ToolPeeyush Ranjan
 
Konferencja Intratic Przyjazny SharePoint, Maciej Pondel, Adam Dolega - Co no...
Konferencja Intratic Przyjazny SharePoint, Maciej Pondel, Adam Dolega - Co no...Konferencja Intratic Przyjazny SharePoint, Maciej Pondel, Adam Dolega - Co no...
Konferencja Intratic Przyjazny SharePoint, Maciej Pondel, Adam Dolega - Co no...
Intratic
 
Deber de iunformatica_paginas_web
Deber de iunformatica_paginas_webDeber de iunformatica_paginas_web
Deber de iunformatica_paginas_web
HENDRYXCH
 
1304505014_erp_tgsmakalah
1304505014_erp_tgsmakalah1304505014_erp_tgsmakalah
1304505014_erp_tgsmakalah
Andis Indrawan
 
Jackie marker resume
Jackie marker resumeJackie marker resume
Jackie marker resume
Jackie Marker
 
19609 τήρηση κανονισμών προβολής και δημοσιότητας
19609 τήρηση κανονισμών προβολής και δημοσιότητας19609 τήρηση κανονισμών προβολής και δημοσιότητας
19609 τήρηση κανονισμών προβολής και δημοσιότηταςΔημήτριος Σιμούδης
 
reume DJ2_COA approved
reume DJ2_COA approvedreume DJ2_COA approved
reume DJ2_COA approvedMatthew Hines
 
Russia's Economic Addictions
Russia's Economic AddictionsRussia's Economic Addictions
Russia's Economic Addictions
iakovosal
 
Multiple Submit Button Test App
Multiple Submit Button Test AppMultiple Submit Button Test App
Multiple Submit Button Test AppPeeyush Ranjan
 
Guide to startup investment
Guide to startup investmentGuide to startup investment
Guide to startup investmentNiek Huizenga
 

Viewers also liked (20)

الإستئناف بداية نهاية الشلل التاريخي - أبو يعرب المرزوقي
الإستئناف   بداية نهاية الشلل التاريخي - أبو يعرب المرزوقيالإستئناف   بداية نهاية الشلل التاريخي - أبو يعرب المرزوقي
الإستئناف بداية نهاية الشلل التاريخي - أبو يعرب المرزوقي
 
System obiegu korespondencji
System obiegu korespondencjiSystem obiegu korespondencji
System obiegu korespondencji
 
الاستئناف بداية نهاية الشلل التاريخي - أبو يعرب المرزوقي
الاستئناف   بداية نهاية الشلل التاريخي - أبو يعرب المرزوقيالاستئناف   بداية نهاية الشلل التاريخي - أبو يعرب المرزوقي
الاستئناف بداية نهاية الشلل التاريخي - أبو يعرب المرزوقي
 
Scrollable Test App
Scrollable Test AppScrollable Test App
Scrollable Test App
 
Online Form Submission App
Online Form Submission AppOnline Form Submission App
Online Form Submission App
 
TextSearch
TextSearchTextSearch
TextSearch
 
Photo Insert and Retrieve App
Photo Insert and Retrieve AppPhoto Insert and Retrieve App
Photo Insert and Retrieve App
 
Transaction Management Tool
Transaction Management ToolTransaction Management Tool
Transaction Management Tool
 
Konferencja Intratic Przyjazny SharePoint, Maciej Pondel, Adam Dolega - Co no...
Konferencja Intratic Przyjazny SharePoint, Maciej Pondel, Adam Dolega - Co no...Konferencja Intratic Przyjazny SharePoint, Maciej Pondel, Adam Dolega - Co no...
Konferencja Intratic Przyjazny SharePoint, Maciej Pondel, Adam Dolega - Co no...
 
Deber de iunformatica_paginas_web
Deber de iunformatica_paginas_webDeber de iunformatica_paginas_web
Deber de iunformatica_paginas_web
 
Aprendiz da vida
Aprendiz da vidaAprendiz da vida
Aprendiz da vida
 
2015 Workplace Relationships
2015 Workplace Relationships2015 Workplace Relationships
2015 Workplace Relationships
 
1304505014_erp_tgsmakalah
1304505014_erp_tgsmakalah1304505014_erp_tgsmakalah
1304505014_erp_tgsmakalah
 
Jackie marker resume
Jackie marker resumeJackie marker resume
Jackie marker resume
 
19609 τήρηση κανονισμών προβολής και δημοσιότητας
19609 τήρηση κανονισμών προβολής και δημοσιότητας19609 τήρηση κανονισμών προβολής και δημοσιότητας
19609 τήρηση κανονισμών προβολής και δημοσιότητας
 
reume DJ2_COA approved
reume DJ2_COA approvedreume DJ2_COA approved
reume DJ2_COA approved
 
Appreciation certificate
Appreciation certificateAppreciation certificate
Appreciation certificate
 
Russia's Economic Addictions
Russia's Economic AddictionsRussia's Economic Addictions
Russia's Economic Addictions
 
Multiple Submit Button Test App
Multiple Submit Button Test AppMultiple Submit Button Test App
Multiple Submit Button Test App
 
Guide to startup investment
Guide to startup investmentGuide to startup investment
Guide to startup investment
 

Similar to Net Beans Codes for Student Portal

College management system.pptx
College management system.pptxCollege management system.pptx
College management system.pptx
ManujArora3
 
Java!!!!!Create a program that authenticates username and password.pdf
Java!!!!!Create a program that authenticates username and password.pdfJava!!!!!Create a program that authenticates username and password.pdf
Java!!!!!Create a program that authenticates username and password.pdf
arvindarora20042013
 
Maze
MazeMaze
Maze
yito24
 
201913046 wahyu septiansyah network programing
201913046 wahyu septiansyah network programing201913046 wahyu septiansyah network programing
201913046 wahyu septiansyah network programing
wahyuseptiansyah
 
Advance Java Programs skeleton
Advance Java Programs skeletonAdvance Java Programs skeleton
Advance Java Programs skeleton
Iram Ramrajkar
 
Ad java prac sol set
Ad java prac sol setAd java prac sol set
Ad java prac sol set
Iram Ramrajkar
 
Need help on creating code using cart. The output has to show multip.pdf
Need help on creating code using cart. The output has to show multip.pdfNeed help on creating code using cart. The output has to show multip.pdf
Need help on creating code using cart. The output has to show multip.pdf
meerobertsonheyde608
 
Manual tecnico
Manual tecnicoManual tecnico
Manual tecnico481200601
 
Create a Code that will add an Add, Edi, and Delete button to the GU.pdf
Create a Code that will add an Add, Edi, and Delete button to the GU.pdfCreate a Code that will add an Add, Edi, and Delete button to the GU.pdf
Create a Code that will add an Add, Edi, and Delete button to the GU.pdf
lakshmijewellery
 
Manual tecnico
Manual tecnicoManual tecnico
Manual tecnico481200601
 
package net.codejava.swing.mail;import java.awt.Font;import java.pdf
package net.codejava.swing.mail;import java.awt.Font;import java.pdfpackage net.codejava.swing.mail;import java.awt.Font;import java.pdf
package net.codejava.swing.mail;import java.awt.Font;import java.pdf
sudhirchourasia86
 
Server1
Server1Server1
Server1
FahriIrawan3
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotation
javatwo2011
 
Ejemplos Interfaces Usuario 3
Ejemplos Interfaces Usuario 3Ejemplos Interfaces Usuario 3
Ejemplos Interfaces Usuario 3martha leon
 
20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx
20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx
20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx
AliHaiderCheema2
 
Write an application containing three parallel arrays that hold 10 e.pdf
Write an application containing three parallel arrays that hold 10 e.pdfWrite an application containing three parallel arrays that hold 10 e.pdf
Write an application containing three parallel arrays that hold 10 e.pdf
izabellejaeden956
 
correct the error and test the code import java.awt.event.Actio.pdf
 correct the  error and test the code import java.awt.event.Actio.pdf correct the  error and test the code import java.awt.event.Actio.pdf
correct the error and test the code import java.awt.event.Actio.pdf
almaniaeyewear
 
#18.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_국비지원IT학원/실업자/재직자환급교육/자바/스프링/...
#18.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_국비지원IT학원/실업자/재직자환급교육/자바/스프링/...#18.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_국비지원IT학원/실업자/재직자환급교육/자바/스프링/...
#18.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_국비지원IT학원/실업자/재직자환급교육/자바/스프링/...
탑크리에듀(구로디지털단지역3번출구 2분거리)
 
Introduction to Spring Boot
Introduction to Spring BootIntroduction to Spring Boot
Introduction to Spring Boot
Purbarun Chakrabarti
 

Similar to Net Beans Codes for Student Portal (20)

College management system.pptx
College management system.pptxCollege management system.pptx
College management system.pptx
 
Java!!!!!Create a program that authenticates username and password.pdf
Java!!!!!Create a program that authenticates username and password.pdfJava!!!!!Create a program that authenticates username and password.pdf
Java!!!!!Create a program that authenticates username and password.pdf
 
Maze
MazeMaze
Maze
 
201913046 wahyu septiansyah network programing
201913046 wahyu septiansyah network programing201913046 wahyu septiansyah network programing
201913046 wahyu septiansyah network programing
 
Advance Java Programs skeleton
Advance Java Programs skeletonAdvance Java Programs skeleton
Advance Java Programs skeleton
 
Ad java prac sol set
Ad java prac sol setAd java prac sol set
Ad java prac sol set
 
Need help on creating code using cart. The output has to show multip.pdf
Need help on creating code using cart. The output has to show multip.pdfNeed help on creating code using cart. The output has to show multip.pdf
Need help on creating code using cart. The output has to show multip.pdf
 
Manual tecnico
Manual tecnicoManual tecnico
Manual tecnico
 
Create a Code that will add an Add, Edi, and Delete button to the GU.pdf
Create a Code that will add an Add, Edi, and Delete button to the GU.pdfCreate a Code that will add an Add, Edi, and Delete button to the GU.pdf
Create a Code that will add an Add, Edi, and Delete button to the GU.pdf
 
Spring
SpringSpring
Spring
 
Manual tecnico
Manual tecnicoManual tecnico
Manual tecnico
 
package net.codejava.swing.mail;import java.awt.Font;import java.pdf
package net.codejava.swing.mail;import java.awt.Font;import java.pdfpackage net.codejava.swing.mail;import java.awt.Font;import java.pdf
package net.codejava.swing.mail;import java.awt.Font;import java.pdf
 
Server1
Server1Server1
Server1
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotation
 
Ejemplos Interfaces Usuario 3
Ejemplos Interfaces Usuario 3Ejemplos Interfaces Usuario 3
Ejemplos Interfaces Usuario 3
 
20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx
20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx
20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx
 
Write an application containing three parallel arrays that hold 10 e.pdf
Write an application containing three parallel arrays that hold 10 e.pdfWrite an application containing three parallel arrays that hold 10 e.pdf
Write an application containing three parallel arrays that hold 10 e.pdf
 
correct the error and test the code import java.awt.event.Actio.pdf
 correct the  error and test the code import java.awt.event.Actio.pdf correct the  error and test the code import java.awt.event.Actio.pdf
correct the error and test the code import java.awt.event.Actio.pdf
 
#18.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_국비지원IT학원/실업자/재직자환급교육/자바/스프링/...
#18.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_국비지원IT학원/실업자/재직자환급교육/자바/스프링/...#18.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_국비지원IT학원/실업자/재직자환급교육/자바/스프링/...
#18.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_국비지원IT학원/실업자/재직자환급교육/자바/스프링/...
 
Introduction to Spring Boot
Introduction to Spring BootIntroduction to Spring Boot
Introduction to Spring Boot
 

More from Peeyush Ranjan

Multiple Hyperlinks App
Multiple Hyperlinks AppMultiple Hyperlinks App
Multiple Hyperlinks AppPeeyush Ranjan
 
Servlet LifeCycle Demo App
Servlet LifeCycle Demo  AppServlet LifeCycle Demo  App
Servlet LifeCycle Demo AppPeeyush Ranjan
 

More from Peeyush Ranjan (6)

Multiple Hyperlinks App
Multiple Hyperlinks AppMultiple Hyperlinks App
Multiple Hyperlinks App
 
Servlet LifeCycle Demo App
Servlet LifeCycle Demo  AppServlet LifeCycle Demo  App
Servlet LifeCycle Demo App
 
Scrollable Demo App
Scrollable Demo AppScrollable Demo App
Scrollable Demo App
 
Cursor Demo App
Cursor Demo AppCursor Demo App
Cursor Demo App
 
Batch processing Demo
Batch processing DemoBatch processing Demo
Batch processing Demo
 
DBTool
DBToolDBTool
DBTool
 

Net Beans Codes for Student Portal

  • 1. Net Beans Codes for Student Portal /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package javaapplication3; import java.sql.*; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.logging.Level; import java.util.logging.Logger; import java.util.*; import javax.swing.JOptionPane; /** * * @author ARTIFICIAL */ public class StudentDetailsForm extends javax.swing.JFrame { /** * Creates new form StudentDetailsForm
  • 2. */ public StudentDetailsForm() throws Exception { Class.forName("oracle.jdbc.driver.OracleDriver"); con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orc l", "system", "password"); 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">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel();
  • 3. jLabel5 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); jLabel9 = new javax.swing.JLabel(); jsname = new javax.swing.JTextField(); jfname = new javax.swing.JTextField(); jmname = new javax.swing.JTextField(); jsession = new javax.swing.JTextField(); jmobile = new javax.swing.JTextField(); jemail = new javax.swing.JTextField(); jScrollPane1 = new javax.swing.JScrollPane(); jadd = new javax.swing.JTextArea(); jbrefresh = new javax.swing.JButton(); jbsubmit = new javax.swing.JButton(); jbranch = new javax.swing.JComboBox(); jdob = new javax.swing.JTextField(); jsid = new javax.swing.JTextField(); jLabel10 = new javax.swing.JLabel(); jrsid = new javax.swing.JRadioButton(); jrsname = new javax.swing.JRadioButton(); jrfname = new javax.swing.JRadioButton(); jrmname = new javax.swing.JRadioButton(); jrdob = new javax.swing.JRadioButton();
  • 4. jrsession = new javax.swing.JRadioButton(); jrmobile = new javax.swing.JRadioButton(); jremail = new javax.swing.JRadioButton(); jrsadd = new javax.swing.JRadioButton(); jbStuentInfo = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_C LOSE); setTitle("STUDENT DETAILS FORM"); jLabel1.setText("Student Name"); jLabel2.setText("Father's Name"); jLabel3.setText("Mother's Name"); jLabel4.setText("Session"); jLabel5.setText("Address"); jLabel6.setText("Mobile no"); jLabel7.setText("Email ID");
  • 5. jLabel8.setText("Branch"); jLabel9.setText("Date of Birth(dd-mm-yy)"); jsname.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jsnameActionPerformed(evt); } }); jfname.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jfnameActionPerformed(evt); } }); jmname.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jmnameActionPerformed(evt); } });
  • 6. jsession.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jsessionActionPerformed(evt); } }); jmobile.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jmobileActionPerformed(evt); } }); jemail.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jemailActionPerformed(evt); } }); jadd.setColumns(20); jadd.setRows(5); jScrollPane1.setViewportView(jadd); jbrefresh.setText("Refresh");
  • 7. jbrefresh.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jbrefreshActionPerformed(evt); } }); jbsubmit.setText("Submit"); jbsubmit.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jbsubmitActionPerformed(evt); } }); jbranch.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "CIVIL ENGINEERING", "MECHANICAL ENGINEERING", "ELECTRICAL ENGINEERING", "ELECTRONICS AND COMMUNICATION ENGINEERING", "COMPUTER SCIENCE AND ENGINEERING" })); jdob.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jdobActionPerformed(evt); }
  • 8. }); jsid.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jsidActionPerformed(evt); } }); jLabel10.setText("Student ID"); jrsid.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jrsidActionPerformed(evt); } }); jrsname.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jrsnameActionPerformed(evt); } }); jrfname.addActionListener(new java.awt.event.ActionListener() {
  • 9. public void actionPerformed(java.awt.event.ActionEvent evt) { jrfnameActionPerformed(evt); } }); jrmname.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jrmnameActionPerformed(evt); } }); jrdob.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jrdobActionPerformed(evt); } }); jrsession.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jrsessionActionPerformed(evt); } });
  • 10. jrmobile.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jrmobileActionPerformed(evt); } }); jremail.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jremailActionPerformed(evt); } }); jrsadd.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jrsaddActionPerformed(evt); } }); jbStuentInfo.setText("Student Info"); jbStuentInfo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) {
  • 11. jbStuentInfoActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEA DING) .addGroup(layout.createSequentialGroup() .addGap(26, 26, 26) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig nment.TRAILING, false) .addGroup(layout.createSequentialGroup() .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE LATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jfname, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup()
  • 12. .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE LATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jmname, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE LATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jmobile, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE LATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jemail, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE))
  • 13. .addGroup(layout.createSequentialGroup() .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(33, 33, 33) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig nment.LEADING) .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE LATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig nment.LEADING, false) .addComponent(jsession)
  • 14. .addComponent(jbranch, 0, 1, Short.MAX_VALUE) .addComponent(jdob, javax.swing.GroupLayout.DEFAULT_SIZE, 166, Short.MAX_VALUE))) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig nment.LEADING, false) .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE) .addComponent(jLabel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE LATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig nment.LEADING, false) .addComponent(jsname) .addComponent(jsid, javax.swing.GroupLayout.DEFAULT_SIZE, 166, Short.MAX_VALUE))) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() .addComponent(jbrefresh) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE LATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jbsubmit)
  • 16. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig nment.BASELINE) .addComponent(jsid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel10) .addComponent(jrsid)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig nment.BASELINE) .addComponent(jLabel1) .addComponent(jsname, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jrsname)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig nment.BASELINE) .addComponent(jfname, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2)
  • 17. .addComponent(jrfname)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig nment.BASELINE) .addComponent(jLabel3) .addComponent(jmname, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jrmname)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig nment.BASELINE) .addComponent(jLabel9) .addComponent(jdob, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jrdob)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig nment.BASELINE) .addComponent(jLabel8)
  • 18. .addComponent(jbranch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig nment.BASELINE) .addComponent(jLabel4) .addComponent(jsession, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jrsession)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig nment.BASELINE) .addComponent(jLabel6) .addComponent(jmobile, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jrmobile)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig nment.BASELINE)
  • 19. .addComponent(jLabel7) .addComponent(jemail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jremail)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig nment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jLabel5) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig nment.LEADING) .addComponent(jrsadd) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addGap(28, 28, 28)
  • 20. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alig nment.BASELINE) .addComponent(jbsubmit) .addComponent(jbrefresh) .addComponent(jbStuentInfo))) ); jsid.getAccessibleContext().setAccessibleName("jsid"); jsid.getAccessibleContext().setAccessibleDescription(""); jsid.getAccessibleContext().setAccessibleParent(jsid); pack(); }// </editor-fold>//GEN-END:initComponents private void jsnameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jsnameActionPerformed }//GEN-LAST:event_jsnameActionPerformed private void jfnameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jfnameActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jfnameActionPerformed
  • 21. private void jmnameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmnameActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jmnameActionPerformed private void jsessionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jsessionActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jsessionActionPerformed private void jmobileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmobileActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jmobileActionPerformed private void jemailActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jemailActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jemailActionPerformed private void jbsubmitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbsubmitActionPerformed try {if(evt.getSource()==jbsubmit){ int s9=Integer.parseInt(jsid.getText()); s=jsname.getText();
  • 22. s1=jfname.getText(); s2=jmname.getText(); //------------date processing starts------------- s3=jdob.getText(); SimpleDateFormat sdf1=new SimpleDateFormat("dd-MM- yy"); java.util.Date udob=sdf1.parse(s3); java.sql.Date sqdob=new java.sql.Date(udob.getTime()); //------------date processing ends---------------- s4=(String)jbranch.getSelectedItem(); s5=jsession.getText(); long s6=Long.parseLong(jmobile.getText()); s7=jemail.getText(); s8=jadd.getText(); qry="insert into studentdetails values(?,?,?,?,?,?,?,?,?,?)" ; ps=con.prepareStatement(qry); //set values on index in table ps.setInt(1, s9); ps.setString(2,s); ps.setString(3,s1); ps.setString(4,s2); ps.setDate(5,sqdob);
  • 23. ps.setString(6,s4); ps.setString(7,s5); ps.setLong(8,s6); ps.setString(9,s7); ps.setString(10,s8); //executing update ps.executeUpdate(); System.out.println("Data Inserted"); ps.close(); con.close(); } } catch (ParseException | SQLException ex) { Logger.getLogger(StudentDetailsForm.class.getName()).log(Level.SEV ERE, null, ex); } }//GEN-LAST:event_jbsubmitActionPerformed private void jbrefreshActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbrefreshActionPerformed if(evt.getSource()==jbrefresh){ jsname.setText(""); jfname.setText(""); jmname.setText(""); jdob.setText("");
  • 24. jsession.setText(""); jmobile.setText(""); jemail.setText(""); jadd.setText(""); jsid.setText(""); } }//GEN-LAST:event_jbrefreshActionPerformed private void jdobActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jdobActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jdobActionPerformed private void jsidActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jsidActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jsidActionPerformed private void jrsidActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrsidActionPerformed if(evt.getSource()==jrsid){ jsid.setText(""); } }//GEN-LAST:event_jrsidActionPerformed
  • 25. private void jrsnameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrsnameActionPerformed if(evt.getSource()==jrsname){ jsname.setText(""); } }//GEN-LAST:event_jrsnameActionPerformed private void jrfnameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrfnameActionPerformed if(evt.getSource()==jrfname){ jfname.setText(""); } }//GEN-LAST:event_jrfnameActionPerformed private void jrmnameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrmnameActionPerformed if(evt.getSource()==jrmname){ jmname.setText(""); } }//GEN-LAST:event_jrmnameActionPerformed private void jrdobActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrdobActionPerformed if(evt.getSource()==jrdob){
  • 26. jdob.setText(""); } }//GEN-LAST:event_jrdobActionPerformed private void jrsessionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrsessionActionPerformed if(evt.getSource()==jrsession){ jsession.setText(""); } }//GEN-LAST:event_jrsessionActionPerformed private void jrmobileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrmobileActionPerformed if(evt.getSource()==jrmobile){ jmobile.setText(""); } }//GEN-LAST:event_jrmobileActionPerformed private void jremailActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jremailActionPerformed if(evt.getSource()==jremail){ jemail.setText(""); } }//GEN-LAST:event_jremailActionPerformed
  • 27. private void jrsaddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrsaddActionPerformed if(evt.getSource()==jrsadd){ jadd.setText(""); } }//GEN-LAST:event_jrsaddActionPerformed private void jbStuentInfoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbStuentInfoActionPerformed if(evt.getSource()==jbStuentInfo){ try { String inputValue =JOptionPane.showInputDialog(this,"Please Enter Valid Student ID"); qry="select * from studentdetails"; ps=con.prepareStatement(qry); rs=ps.executeQuery(); //process ResultSet obj while(rs.next()){ if (inputValue.equals((rs.getString(1)))){ //getting the field values jsid.setText(rs.getString(1)); jsname.setText(rs.getString(2)); jfname.setText(rs.getString(3)); jmname.setText(rs.getString(4));
  • 28. //dob retrieving codings begin... java.sql.Date sqdob=rs.getDate(5); //dob retrieving codings ends here.. jbranch.setSelectedItem(rs.getString(6)); jsession.setText(rs.getString(7)); jmobile.setText(rs.getString(8)); jemail.setText(rs.getString(9)); jadd.setText(rs.getString(10)); }//inner if } //inner while }//try catch (SQLException ex) { Logger.getLogger(StudentDetailsForm.class.getName()).log(Level.SEV ERE, null, ex); } }//outer if }//GEN-LAST:event_jbStuentInfoActionPerformed
  • 29. /** * @param args the command line arguments */ public static void main(String args[]) { /* * Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* * If Nimbus (introduced in Java SE 6) is not available, stay with the * default look and feel. For details see * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/pla f.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; }
  • 30. } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(StudentDetailsForm.class.getNam e()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(StudentDetailsForm.class.getNam e()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(StudentDetailsForm.class.getNam e()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(StudentDetailsForm.class.getNam e()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* * Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { @Override
  • 31. public void run() { try { new StudentDetailsForm().setVisible(true); } catch (Exception ex) { Logger.getLogger(StudentDetailsForm.class.getName()).log(Level.SEV ERE, null, ex); } } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel10; 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.JScrollPane jScrollPane1; private javax.swing.JTextArea jadd;
  • 32. private javax.swing.JButton jbStuentInfo; private javax.swing.JComboBox jbranch; private javax.swing.JButton jbrefresh; private javax.swing.JButton jbsubmit; private javax.swing.JTextField jdob; private javax.swing.JTextField jemail; private javax.swing.JTextField jfname; private javax.swing.JTextField jmname; private javax.swing.JTextField jmobile; private javax.swing.JRadioButton jrdob; private javax.swing.JRadioButton jremail; private javax.swing.JRadioButton jrfname; private javax.swing.JRadioButton jrmname; private javax.swing.JRadioButton jrmobile; private javax.swing.JRadioButton jrsadd; private javax.swing.JRadioButton jrsession; private javax.swing.JRadioButton jrsid; private javax.swing.JRadioButton jrsname; private javax.swing.JTextField jsession; private javax.swing.JTextField jsid; private javax.swing.JTextField jsname; // End of variables declaration//GEN-END:variables private Connection con; private Statement st;
  • 33. private ResultSet rs,rs1; private String s,s1,s2,s3,s4,s5,s7,s8,qry; private PreparedStatement ps; }