JDBC处理SQL NULL值
PreparedStatementstmt = null;sql = "UPDATE TEMPL SET PHONENO = ? "
+ "WHERE EMPNO = '000110' ";
stmt = con.prepareStatement(sql);
if (some condition)
{ stmt.setString (1, name);}
else
{ stmt.setString (1, newphone); }
updateCount = stmt.executeUpdate();
}
页:
[1]