• 2022-06-11
    已知,存在 QueryRunner对象 runner , SQL语句:String sql = "select * from user";下面操作中,能实现查询所有记录的选项是( )
    A: Object list=runner.query(sql, new BeanHandler<User>(User.class));
    B: List list=runner.query(sql, new BeanHandler<User>(User.class));
    C: List<User> list=runner.query(sql, new BeanHandler<User>(User.class));
    D: List<User> list=runner.query(sql, new BeanListHandler<User>(User.class));Object num =runner.delete(1, sql);
  • D

    举一反三

    内容

    • 0

      已知,存在 QueryRunner对象 runner ,SQL语句: String sql = "delete from user where id=?"; 下面操作中,能实现删除记录id=1的操作是() A: int num =runner.delete(sql, 1); B: int num =runner.update(sql, 1); C: Object num =runner.delete(1, sql); D: Object num =runner.update(1, sql);

    • 1

      下列选项中,可以删除表user中所有记录的SQL语句是( )。 A: DELETE TABLE `user` B: DELETE FROM `user` C: DELETE `user` D: ALTER TABLE DELETE `user`

    • 2

      使用SQLiteDatabase对象db,从user表中查找name为tom的记录,使用的语句为: A: db. query("user",null,"name=?",new String[]{"tom"},null,null,null) B: db. query("user",null,"name",new String[]{"tom"},null,null,null) C: db. query("user",null,"name=?",new String[]{tom},null,null,null) D: db. query("user",null,"name=tom",null,null,null,null)

    • 3

      以下PHP代码,用来查询mysql数据库中的User表,若能正常连接数据库,则以下选项中能正确执行$sql的查询语句的是()[br][/br]&#91;?php<br&#93;……[br][/br]$conn = new mysqli($servername, $username, $password, $dbname);[br][/br]$sql ="select * from User";[br][/br]( ); A: mysqli_query($conn, $sql); B: $conn->execute($sql); C: $conn->query($sql); D: query($sql);

    • 4

      下列SQL语句中能查看MySQL数据库用户帐号的是()。 A: SELECT user FROM mysql.user; B: SELECT USER();c、SELECT * FROM user;D、SELECT user FROM mysql;