preparedstatement要如何處理mysql類型中的char類型及char數組類型。比如說:建立admins表:create table admins(userID int auto_increment primary key,name varchar(20) not null,gender char default 'M',password char(32) not null) admins表里面gender是單字符類型(M代表男性,F代表女性),password是字符數組類型(定長32),現在我通過jdbc想插入一個值進去,用preparedstatement怎么實現。PreparedStatement類無setChar()方法,如何處理表中的gender值 是否可用preparedstatement.setString(index,convert(gender,char));(但jdk里的包無convert這個函數)。So what should I deal with the gender and password?
添加回答
舉報
0/150
提交
取消