📄 selectcourse.java
字号:
package mainpacket;import static mainpacket.JDBCConnectionFactory.*;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.sql.Connection;import java.sql.PreparedStatement;import java.sql.ResultSet;import java.sql.SQLException;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JOptionPane;import javax.swing.JTable;import javax.swing.JTextField;public class Selectcourse implements ActionListener { private Connection conn=getConnection(); private PreparedStatement pstmt; private PreparedStatement pstmt1; private JTextField jtf; private ResultSet rs; private ResultSet rs1; private JFrame jframe; private JTable jt; public Selectcourse(JTextField jtf,JFrame jrame,JTable jt){ this.jtf=jtf; this.jframe=jframe; this.jt=jt; } public void actionPerformed(ActionEvent e) { String s=jtf.getText(); System.out.println(s); String ss=null; try { pstmt=conn.prepareStatement("select * from result1_wdf where cname='"+s.trim()+"'"); rs=pstmt.executeQuery(); if(!rs.next()){ JOptionPane jp=new JOptionPane(); JLabel l=new JLabel(); l.setText("鏃犳
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -