我有以下课程:
public class customer_master extends javax.swing.JInternalFrame {
Connection con = null;
PreparedStatement ps = null;
ResultSet rs = null;
JFrame parent;
public customer_master(JFrame parent) {
this.parent=parent;
initComponents();
try {
String qry="select customer_code, customer_name, customer_address, customer_created_time from customer";
database.JavaConnect jc= new JavaConnect();
con = jc.ConnectDB();
ps = con.prepareStatement(qry);
rs = ps.executeQuery();
jTable1.setModel(DbUtils.resultSetToTableModel(rs));
con.close();
}
catch(SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}
}
它还更改了列的名称,但如果有人可以提供帮助,我想在不更改列名称的情况下添加 rs。提前致谢。