• 2022-06-04 问题

    假定已经获得一个数据库连接,使用变量conn来表示。下列语句中能够正确获得结果集的有__1__。(选择两项)[br][/br] A.Statement stmt = conn.createStatement()__2__;[br][/br] ResultSet rs = stmt.executeQuery(“SELECT * FROM STUDENT”);[br][/br] B.Statement stmt = conn.createStatement(“SELECT * FROM STUDENT”);[br][/br] ResultSet rs = stmt.executeQuery()__3__;[br][/br] C.PreparedStatement stmt = conn.prepareStatement()__4__;[br][/br] ResultSet rs = stmt.executeQuery(“SELECT * FROM STUDENT”);[br][/br] D.PreparedStatement stmt = conn.prepareStatement(“SELECT * FROM STUDENT”);[br][/br] ResultSet rs = stmt.executeQuery()__5__;

    假定已经获得一个数据库连接,使用变量conn来表示。下列语句中能够正确获得结果集的有__1__。(选择两项)[br][/br] A.Statement stmt = conn.createStatement()__2__;[br][/br] ResultSet rs = stmt.executeQuery(“SELECT * FROM STUDENT”);[br][/br] B.Statement stmt = conn.createStatement(“SELECT * FROM STUDENT”);[br][/br] ResultSet rs = stmt.executeQuery()__3__;[br][/br] C.PreparedStatement stmt = conn.prepareStatement()__4__;[br][/br] ResultSet rs = stmt.executeQuery(“SELECT * FROM STUDENT”);[br][/br] D.PreparedStatement stmt = conn.prepareStatement(“SELECT * FROM STUDENT”);[br][/br] ResultSet rs = stmt.executeQuery()__5__;

  • 2021-04-14 问题

    下列代码生成了一个结果集stmt=conn.createSt...k);下面对该rs描述正确的是(

    下列代码生成了一个结果集stmt=conn.createSt...k);下面对该rs描述正确的是(

  • 2021-04-14 问题

    编写一个程序,查询Access数据库Database1中Student表中的信息,其中数据库Database1对应的数据源为myData。 import java.sql.*; public class DataDemo { public static void main(String args[]) throws Exception { Class.forName(______(1)_______); //加载JDBC-ODBC驱动程序 Connection conn = DriverManager.getConnection(_____(2)____,””,””); //连接ODBC数据源myData Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery(____(3)_____); //返回Student表所有行 while (rs.next()) { System.out.println(rs.getString(2)); } if (rs!=null)) rs.close(); if(stmt!=null) ____(4)_____; //关闭stmt对象 if(conn!=null) ____(5)_____; //关闭conn对象 } }

    编写一个程序,查询Access数据库Database1中Student表中的信息,其中数据库Database1对应的数据源为myData。 import java.sql.*; public class DataDemo { public static void main(String args[]) throws Exception { Class.forName(______(1)_______); //加载JDBC-ODBC驱动程序 Connection conn = DriverManager.getConnection(_____(2)____,””,””); //连接ODBC数据源myData Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery(____(3)_____); //返回Student表所有行 while (rs.next()) { System.out.println(rs.getString(2)); } if (rs!=null)) rs.close(); if(stmt!=null) ____(4)_____; //关闭stmt对象 if(conn!=null) ____(5)_____; //关闭conn对象 } }

  • 2021-04-14 问题

    stmt 为Statement对象,执行String sqlStatement=”delete from book where bid=’tp1001’”;语句后,删除数据库表的记录需要执行____语句

    stmt 为Statement对象,执行String sqlStatement=”delete from book where bid=’tp1001’”;语句后,删除数据库表的记录需要执行____语句

  • 2022-06-09 问题

    以下哪个选项是连接并创建数据库的语句: A: Class.forName("org.sqlite.JDBC"); B: Connection c=DriverManager.getConnection("jdbc:sqlite:测试.db"); C: Statement stmt=c.createStatement();

    以下哪个选项是连接并创建数据库的语句: A: Class.forName("org.sqlite.JDBC"); B: Connection c=DriverManager.getConnection("jdbc:sqlite:测试.db"); C: Statement stmt=c.createStatement();

  • 2022-06-05 问题

    stmt为Statement对象,执行String sqlStatement = "delete from book where bid='tp1001' ";语句后,删除数据库表的记录需要执行stmt.executeUpdate ( )语句

    stmt为Statement对象,执行String sqlStatement = "delete from book where bid='tp1001' ";语句后,删除数据库表的记录需要执行stmt.executeUpdate ( )语句

  • 2022-06-09 问题

    下面选项中,主要用于执行DML和DDL语句的是(<br/>) A: ResultSet<br/>rs = stmt.executeDDL(sql); B: ResultSet<br/>rs = stmt.executeUpdate(sql); C: ResultSet<br/>rs = stmt.executeDelete(sql); D: ResultSet<br/>rs = stmt.executeDML(sql);

    下面选项中,主要用于执行DML和DDL语句的是(<br/>) A: ResultSet<br/>rs = stmt.executeDDL(sql); B: ResultSet<br/>rs = stmt.executeUpdate(sql); C: ResultSet<br/>rs = stmt.executeDelete(sql); D: ResultSet<br/>rs = stmt.executeDML(sql);

  • 2022-05-28 问题

    用于stmt执行查询语句,执行后返回代表结果集的ResultSet对象rs的实现代码是___。(注:代码后加英文分号)

    用于stmt执行查询语句,执行后返回代表结果集的ResultSet对象rs的实现代码是___。(注:代码后加英文分号)

  • 2022-06-05 问题

    要在Statement对象stmt上执行SELECT语句“select*fromAddress”,可以使用________。 A: stmt.execute("select*fromAddress"); B: stmt.executeQuery("select*fromAddress"); C: stmt.executeUpdate("select*fromAddress"); D: stmt.query("select*fromAddress");

    要在Statement对象stmt上执行SELECT语句“select*fromAddress”,可以使用________。 A: stmt.execute("select*fromAddress"); B: stmt.executeQuery("select*fromAddress"); C: stmt.executeUpdate("select*fromAddress"); D: stmt.query("select*fromAddress");

  • 2021-04-14 问题

    下列代码生成了一个结果集 conn=DriverManager.getConnection(uri,user,password); stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY); rs=stmt.executeQuery("select * from book"); 下面哪项对该rs描述正确

    下列代码生成了一个结果集 conn=DriverManager.getConnection(uri,user,password); stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY); rs=stmt.executeQuery("select * from book"); 下面哪项对该rs描述正确

  • 1 2 3