我的数据库性别类型是枚举enum,然后string‘女’插入时可以,
更新时就是Data truncated for column 'sex' at row 1;
更新时就是Data truncated for column 'sex' at row 1;
解决方案 »
- toad for mysql有没有中文教程呀,
- mysql延迟怎么设置
- PostgreSQL 同时满足多组条件怎么写查询语句
- mysql锁问题
- 【Mysql-6.0.9】 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
- innodb lock table
- 关于php用adodb连接数据库的问题
- 为什么在MySQL数据库录入记录时报1366错误
- mysql-5.6.26版本 找不到 my.ini配置文件的所在 求指教
- mysql经常性的报Reading from the stream has failed.
- 如何建立索引
- JAVA对MYSQL数据库插入的菜鸟问题..
man = new JRadioButton("男");
woman = new JRadioButton("女");public String gender()
{
String Gender;
if(man.isSelected())
{
Gender = man.getText();
}
else
{
Gender = woman.getText();
} return Gender;
}
'截至2012-05-26 21:25:21 用户结帖率0.00% 当您的问题得到解答后请及时结贴.
http://topic.csdn.net/u/20090501/15/7548d251-aec2-4975-a9bf-ca09a5551ba5.html
http://topic.csdn.net/u/20100428/09/BC9E0908-F250-42A6-8765-B50A82FE186A.html
http://topic.csdn.net/u/20100626/09/f35a4763-4b59-49c3-8061-d48fdbc29561.html8、如何给分和结贴?
http://community.csdn.net/Help/HelpCenter.htm#结帖
str1 +"',operator_tel= '" + str2 + "', operatorinfo.sex = '女' where operator_id= '" + operatorid + "'";
stmt.execute(sql);
conn.commit();
CREATE TABLE `operatorinfo` (
`operator_id` int(12) NOT NULL,
`operator_name` varchar(20) NOT NULL,
`operator_tel` varchar(20) DEFAULT NULL,
`sex` enum('') NOT NULL,
`password` int(20) NOT NULL,
`isadmin` enum('yes','no') NOT NULL,
PRIMARY KEY (`operator_id`)
) ENGINE=InnoDB DEFAULT CHARSET=gbk;建表语句更新语句
update operatorinfo set operator_name= '" +
str1 +"',operator_tel= '" + str2 + "', operatorinfo.sex = '女' where operator_id= '" + operatorid + "'"
我最后发现是我的java代码里radio控件忘了填默认值。