資源簡介
Made by dgl ,這個是我用java做的一個數據庫課設,有點不足之處,我沒做模糊查詢,各位可以自己參考修改完善下哈。
代碼片段和文件信息
package?com.lin.sql;
import?javax.swing.JPanel;
import?javax.swing.JLabel;
import?javax.swing.JOptionPane;
import?javax.swing.JTextField;
import?java.awt.event.ActionEvent;
import?java.awt.event.ActionListener;
import?java.awt.event.ItemEvent;
import?java.awt.event.ItemListener;
import?java.sql.Connection;
import?java.sql.PreparedStatement;
import?java.sql.ResultSet;
import?java.sql.SQLException;
import?java.sql.Statement;
import?javax.swing.AbstractButton;
import?javax.swing.ButtonGroup;
import?javax.swing.DefaultComboBoxModel;
import?javax.swing.JComboBox;
import?javax.swing.JRadioButton;
import?javax.swing.JButton;
public?class?Addinformation?extends?JPanel?{
/**
?*?
?*/
private?static?final?long?serialVersionUID?=?1L;
private?JTextField?Stuidvalue;
private?JTextField?Namevalue;
private?JTextField?Birthdayvalue;
private?JTextField?Hometownvalue;
private?JComboBox?collegevalue;
private?JComboBox?majorvalue;
private?Connection?ct?=?new?ConnectionDB().getConnection();
private?Statement?stmt?=?null;
private?AbstractButton?radioButton;
private?AbstractButton?radioButton_1;
private?AbstractButton?men;
private?AbstractButton?women;
private?String?sx?=?“男“;
private?String?xueyuan?=?null;//?學院ID
private?String?nuw?=?null;//?專業id
private?String?zhiye?=?null;//?職業id
private?JButton?sureadd?=?new?JButton(“\u786E\u5B9A\u6DFB\u52A0“);
private?JComboBox?year?=?new?JComboBox();
private?JComboBox?month?=?new?JComboBox();
private?String?tag?=?“待就業“;
public?Addinformation()?{
setToolTipText(“\u8BA1\u7B97\u673A\r\n\u4E66“);
setLayout(null);
JLabel?Stuid?=?new?JLabel(“學號“);
Stuid.setBounds(35?27?72?18);
add(Stuid);
Stuidvalue?=?new?JTextField();
Stuidvalue.setBounds(121?24?128?24);
add(Stuidvalue);
Stuidvalue.setColumns(10);
Namevalue?=?new?JTextField();
Namevalue.setColumns(10);
Namevalue.setBounds(121?64?128?24);
add(Namevalue);
JLabel?name?=?new?JLabel(“姓名“);
name.setBounds(35?67?72?18);
add(name);
JLabel?Birthday?=?new?JLabel(“出生年月“);
Birthday.setBounds(35?154?72?18);
add(Birthday);
Hometownvalue?=?new?JTextField();
Hometownvalue.setColumns(10);
Hometownvalue.setBounds(121?190?128?24);
add(Hometownvalue);
JLabel?Hometown?=?new?JLabel(“籍貫“);
Hometown.setBounds(35?193?72?18);
add(Hometown);
JLabel?major?=?new?JLabel(“專業“);
major.setBounds(296?67?72?18);
add(major);
JComboBox?majorvalue?=?new?JComboBox();
try?{
PreparedStatement?ps2?=?ct.prepareStatement(“select??Zymc?from?tb_Zyinfo??order?by?Zybh?asc“);
ResultSet?rs2?=?ps2.executeQuery();
while?(rs2.next())//?利用循環,讀取每條記錄
{
majorvalue.addItem(rs2.getobject(1));//?將每條記錄添加到jComboBox3中去
}
}?catch?(SQLException?e)?{
//?TODO?Auto-generated?catch?block
e.printStackTrace();
}
majorvalue.setBounds(395?64?141?24);
add(majorvalue);
majorvalue.setSelectedIndex(
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
????.......???????404??2018-02-18?11:41??Madebydgl\Lin\Lin\.classpath
????.......???????379??2018-02-07?18:21??Madebydgl\Lin\Lin\.project
????.......???????598??2018-02-07?18:21??Madebydgl\Lin\Lin\.settings\org.eclipse.jdt.core.prefs
?????文件???????1389??2018-03-09?14:09??Madebydgl\Lin\Lin\bin\com\lin\sql\Addinformation$1.class
?????文件???????1389??2018-03-09?14:09??Madebydgl\Lin\Lin\bin\com\lin\sql\Addinformation$2.class
?????文件???????1328??2018-03-09?14:09??Madebydgl\Lin\Lin\bin\com\lin\sql\Addinformation$3.class
?????文件???????1326??2018-03-09?14:09??Madebydgl\Lin\Lin\bin\com\lin\sql\Addinformation$4.class
?????文件???????3722??2018-03-09?14:09??Madebydgl\Lin\Lin\bin\com\lin\sql\Addinformation$5.class
?????文件???????1051??2018-03-09?14:09??Madebydgl\Lin\Lin\bin\com\lin\sql\Addinformation$6.class
?????文件???????9210??2018-03-09?14:09??Madebydgl\Lin\Lin\bin\com\lin\sql\Addinformation.class
?????文件???????1498??2018-03-09?14:09??Madebydgl\Lin\Lin\bin\com\lin\sql\Addmenuetab.class
?????文件???????1936??2018-03-09?14:09??Madebydgl\Lin\Lin\bin\com\lin\sql\Colleage$1.class
?????文件???????1140??2018-03-09?14:09??Madebydgl\Lin\Lin\bin\com\lin\sql\Colleage$2.class
?????文件???????1140??2018-03-09?14:09??Madebydgl\Lin\Lin\bin\com\lin\sql\Colleage$3.class
?????文件???????1939??2018-03-09?14:09??Madebydgl\Lin\Lin\bin\com\lin\sql\Colleage$4.class
?????文件???????2652??2018-03-09?14:09??Madebydgl\Lin\Lin\bin\com\lin\sql\Colleage.class
?????文件???????1853??2018-03-09?14:09??Madebydgl\Lin\Lin\bin\com\lin\sql\ConnectionDB.class
?????文件????????791??2018-03-09?14:09??Madebydgl\Lin\Lin\bin\com\lin\sql\Daiye$1$1.class
?????文件???????3316??2018-03-09?14:09??Madebydgl\Lin\Lin\bin\com\lin\sql\Daiye$1.class
?????文件???????3682??2018-03-09?14:09??Madebydgl\Lin\Lin\bin\com\lin\sql\Daiye.class
?????文件???????2271??2018-03-09?14:09??Madebydgl\Lin\Lin\bin\com\lin\sql\Danwei$1.class
?????文件???????1163??2018-03-09?14:09??Madebydgl\Lin\Lin\bin\com\lin\sql\Danwei$2.class
?????文件???????3968??2018-03-09?14:09??Madebydgl\Lin\Lin\bin\com\lin\sql\Danwei.class
?????文件???????1953??2018-03-09?14:09??Madebydgl\Lin\Lin\bin\com\lin\sql\deldanwei$1.class
?????文件???????1529??2018-03-09?14:09??Madebydgl\Lin\Lin\bin\com\lin\sql\deldanwei$2.class
?????文件???????4476??2018-03-09?14:09??Madebydgl\Lin\Lin\bin\com\lin\sql\deldanwei.class
?????文件???????1957??2018-03-09?14:09??Madebydgl\Lin\Lin\bin\com\lin\sql\Deletes$1.class
?????文件???????1537??2018-03-09?14:09??Madebydgl\Lin\Lin\bin\com\lin\sql\Deletes$2.class
?????文件???????4816??2018-03-09?14:09??Madebydgl\Lin\Lin\bin\com\lin\sql\Deletes.class
?????文件???????1334??2018-03-09?14:09??Madebydgl\Lin\Lin\bin\com\lin\sql\deltab.class
............此處省略60個文件信息
- 上一篇:Android播放在線音頻文件
- 下一篇:Android移動警務查詢系統
評論
共有 條評論