重新学下Java基本语法,搞清楚什么是变量,字符串怎么拼接变量
"delete from teacherinfo where no='b'"
数据库执行的SQL就是delete from teacherinfo where no='b';
String b = "001";
"delete from teacherinfo where no='" + b + "'";
数据库执行的SQL才会是delete from teacherinfo where no='001'
最后再去了解下JDBC预编译语句,用替换占位符方式代替字符串拼接变量方式