学生选课系统(连接Mysql数据库).docx
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
学生选课系统(连接Mysql数据库) /* JDBC连接数据库 */ package immoc4.bao; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class JDBC { private static final String URL = "jdbc:mysql://localhost:3306/a?characterEncoding=utf8"; private static final String USER = "root"; private static final String PASSWORD = "995923"; private static Connection conn = null; static { try { Class.forName("com.mysql.jdbc.Driver"); conn = DriverManager.getConnection(URL, USER, PASSWORD); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } } public static Connection getConnection() { return conn; } } /* 登录界面 学生选课系统(连接Mysql数据库)全文共18页,当前为第1页。*/ 学生选课系统(连接Mysql数据库)全文共18页,当前为第1页。 package immoc4.bao; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.sql.SQLException; import java.util.Scanner; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField; public class View extends JFrame{ static GongNeng gn = new GongNeng(); static Student s = new Student(); static JTextField text1; static JTextField text2; static JButton button; public void denglu(){ setLayout(new FlowLayout()); add(new JLabel("用户id:")); text1 = new JTextField(20); add(text1); add(new JLabel("密码:")); text2 = new JTextField(20); add(text2); button = new JButton("登录"); add(button); setVisible(true); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //关闭窗口 } public static void main(String []args){ 学生选课系统(连接Mysql数据库)全文共18页,当前为第2页。 View dl = new View(); 学生选课系统(连接Mysql数据库)全文共18页,当前为第2页。 dl.setBounds(300, 300, 300, 200); dl.setTitle("学生选课管理系统"); dl.denglu(); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // TODO Auto-generated method stub dl.dispose(); s.setStudent_id(Integer.parseInt(text1.getText())); s.setStudent_code(text2.getText()); try { g
剩余17页未读,继续阅读
- 粉丝: 168
- 资源: 3万+
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助