求教为什么要这样写 为什么要写成 '" + name + "'为什么有加号,为什么双引号外面还要+个单引号
String sql = "select * from t where username = '" + name + "' and password = '" + passwd + "'";
String sql = "insert into emp(empno, ename, job, mgr, hiredate, sal, comm, deptno) values("
+ emp.getEmpNo()
+ ", "
+ " '"
+ emp.getEname()
+ "', "
+ " '"
+ emp.getJob()
+ "', "
+ emp.getMgr()
+ ","
+ "to_date('"
+ emp.getHiredate()
+ "','yyyy-mm-dd'), "
+ emp.getSal()
+ ", "
+ emp.getComm() + ", " + emp.getDeptno() + ")";