4)生成完整的sql语句并执行
if(OperType.equals("insert"))
opSql=insSql1.substring(0,insSql1.length()-1)+")"+
insSql2.substring(0,insSql2.length()-1)+")";
if(OperType.equals("update"))
opSql=updateSql.substring(0,updateSql.length()-1)+
" "+whereSql;if(OperType.equals("delete")) opSql="delete FROM "+tablename+" "+whereSql;
//已生成完整的sql语句opSql
try{
sqlnrows=Stmt.executeUpdate(opSql);
} catch(SQLException e){
out.println("SQLException:"+opSql);
}
文章来源于领测软件测试网 https://www.ltesting.net/