String sql ="select * from log where name='?' and code='?';";改成
String sql ="select * from log where name=?and code=?“;