基于JAVA和Oracle的系统,基于Java和Oracle的学生信息管理系统

String pad = password.getText();

String sql1=\+id+\; if(e.getSource()==Changepassword) {

try { }

catch (ClassNotFoundException ce) { } try {

Connection con =

JOptionPane.showMessageDialog(s,ce.getMessage()); Class.forName(\);

String sql2=\+id+\+pad+\;

DriverManager.getConnection(\,\\,\);

Statement stmt = con.createStatement();

ResultSet rs = stmt.executeQuery(\);

rs=stmt.executeQuery(\ID='\+id+\);

if(id.equals(\)) {

JOptionPane.showMessageDialog(s,\学号未填写!\); }

else if(rs.next())//如果账号存在 {

if(pad.equals(0)) { }

49

JOptionPane.showMessageDialog(s,\密码未填写!\);

else { \);

setVisible(false); } rs.close(); stmt.close();

stmt.executeUpdate(sql1); stmt.executeUpdate(sql2);

{

JOptionPane.showMessageDialog(s,\密码已重置!

} } else {

JOptionPane.showMessageDialog(s,\学号不存在,请重新输入正确的学号!\); }

}

public static void main(String[] args)

50

}

}

catch (SQLException se) { }

JOptionPane.showMessageDialog(s,se.getMessage());

else { }

ID.setText(\); password.setText(\); ID.requestFocus();

}

{ }

@SuppressWarnings(\)

Changepassword ch = new Changepassword();

3.5.教师修改登录密码模块 //函数库

import javax.swing.*; import java.awt.event.*; import java.sql.*;

public class tchlogpassword extends JFrame implements ActionListener {

private static final long serialVersionUID = 1L; /*修改登陆密码控件*/ static Changepassword s; JPanel jpl = new JPanel();

JLabel label1 = new JLabel(\账 号\,JLabel.LEFT); JLabel label2 = new JLabel(\原 密 码\,JLabel.LEFT); JLabel label3 = new JLabel(\新 密 码\,JLabel.LEFT); JTextField ID = new JTextField();

JTextField oldpassword = new JTextField(); JTextField password = new JTextField();

JButton Changepassword = new JButton(\重 置\); JButton reset = new JButton(\清 空\); public tchlogpassword() {

super(\修改登陆密码(教师)\); this.setSize(500,400); this.setVisible(true); //将当前窗口防止在屏幕中央 setLocationRelativeTo(null); this.setResizable(false);

51

}

this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.add(jpl); jpl.setLayout(null);

Changepassword.addActionListener(this); reset.addActionListener(this); label1.setBounds(140,120,50,20); jpl.add(label1);

ID.setBounds(190,120,150,20); jpl.add(ID);

label2.setBounds(140,160,50,20); jpl.add(label2);

oldpassword.setBounds(190,160,150,20); jpl.add(oldpassword);

label3.setBounds(140,200,50,20); jpl.add(label3);

password.setBounds(190,200,150,20); jpl.add(password);

Changepassword.setBounds(190,240,70,20); jpl.add(Changepassword); reset.setBounds(270,240,70,20); jpl.add(reset);

public void actionPerformed(ActionEvent e) {

String id = ID.getText();

String oldpad = oldpassword.getText(); String pad = password.getText(); if(e.getSource()==Changepassword) {

try {

52

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值