java中combobox的值无法加入数据库
sql="insertinto学生信息表values('"+textField学号.getText()+"','"+textFieldname.getText()+"',...
sql="insert into 学生信息表 values('" +textField学号.getText()+"','"+ textFieldname.getText() +"','"+ combox性别.getSelectedItem().toString() +"','"+ textFieldnation.getText() +"',"+ textField年龄.getText() +",'"+ combox年级.getSelectedItem().toString() +"','"+ textField班级.getText() +"','"+ combox专业.getSelectedItem().toString() +"')";
哪里出问题了??求高手指点
这样解决的 :private String[] sex = { "男", "女", };private String[] subject = {"软件技术", "电气信息", "自动化", "英语"};private String[] nianji = {"0941", "1041", "1141", "1241"};private JComboBox combox性别 =new JComboBox(sex);private JComboBox combox专业 =new JComboBox(subject);private JComboBox combox年级 =new JComboBox(nianji); 展开
哪里出问题了??求高手指点
这样解决的 :private String[] sex = { "男", "女", };private String[] subject = {"软件技术", "电气信息", "自动化", "英语"};private String[] nianji = {"0941", "1041", "1141", "1241"};private JComboBox combox性别 =new JComboBox(sex);private JComboBox combox专业 =new JComboBox(subject);private JComboBox combox年级 =new JComboBox(nianji); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询