???PreparedStatement?????????
???????????? ???????[ 2014/3/13 9:25:54 ] ????????????? ???
????java.sql.PreparedStatement????PrepareStatement?????Statement????
????PrepatredStatement?????????????SQL???????PreparedStatement?????????????????????????????Statement????
??????????PreparedStatement?????е?SQL?????????????IN??????IN?????????SQL??????δ?????????????????IN???????????????“??”??????λ????????????????????????????????????Setxxx????????
???????????£?
public void add(BookInfAdd bookinfadd){
String sqlStr ="insert into booktypeadd values(??????????????????????)";
try (PreparedStatement s =DBconnection.getConnection().prepareStatement(sqlStr)){
s.setString(1??bookinfadd.getType());
s.setString(2??bookinfadd.getBookname());
s.setString(3??bookinfadd.getActor());
s.setString(4??bookinfadd.getChubanshe());
s.setString(5??bookinfadd.getYizhe());
s.setString(6??bookinfadd.getChubanriqi());
s.setString(7??bookinfadd.getDanjia());
s.setInt(8??Integer.parseInt(bookinfadd.getISBN()));
s.executeUpdate();
int result =s.executeUpdate();
if(result>0){
System.out.println("?????");
}
} catch (SQLException ex) {
ex.printStackTrace();
}
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11