怎么突然多了一段代码出来?
讲课没有讲这里吧,怎么突然多了这么一段代码?回头看了几遍视频,没有看漏啊。。
StringBuilder sb=new StringBuilder();
sb.append("select id,user_name,age from imooc_goddess ");
PreparedStatement ptmt=conn.prepareStatement(sb.toString());
问题1:这段代码跟之前的有什么区别?
之前的是这样的:
String sql="" +
" delete from imooc_goddess " +
" where id=? ";
PreparedStatement ptmt=conn.prepareStatement(sql);
问题2:
String sql="" +
" delete from imooc_goddess " +
" where id=? ";
为什么不写成
String sql=" delete from imooc_goddess where id=? ";