要在Connection对象conn上创建Statement对象,可以使用________: Statement statement = Connection.createStatement();|Statement statement = conn.createStatement();|Statement statement = conn.statement();|Statement statement = connection.create();
举一反三
- 以下语句可以创建Statement接口对象的是( ) A: Statement sm = new Statement() B: Statement sm = conn. createStatement(); (注:conn为数据连接对象) C: Statement sm = conn. getStatement ();(注:conn为数据连接对象) D: Statement sm = conn. prepareStatement ();(注:conn为数据连接对象)
- 以下语句可以创建Statement接口对象的是( )(注:conn为数据连接对象) A: Statement sm = new Statement() B: Statement sm = conn. createStatement(); C: Statement sm = conn. getStatement (); D: Statement sm = conn. prepareStatement ();
- Statement对象是通过Connection对象的什么方法创建的? A: preparedStatement( ) B: statement( ) C: createStatement ( ) D: prepareCall( )
- 2.cn是Connection对象,创建Statement 对象的方法是( ) A: Statement st=new Statement (); B: Statement st=cn.newStatement() C: Statement st=cn.createNewStatement() D: Statement st=cn.createStatement()
- 现在已经有一个Connection类的对象conn,建立一个Statement对象stat的语句是:__________________。