以下语句可以创建Statement接口对象的是( )
A: Statement sm = new Statement()
B: Statement sm = conn. createStatement(); (注:conn为数据连接对象)
C: Statement sm = conn. getStatement ();(注:conn为数据连接对象)
D: Statement sm = conn. prepareStatement ();(注:conn为数据连接对象)
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 ();
- 要在Connection对象conn上创建Statement对象,可以使用________: Statement statement = Connection.createStatement();|Statement statement = conn.createStatement();|Statement statement = conn.statement();|Statement statement = connection.create();
- 现在已经有一个Connection类的对象conn,建立一个Statement对象stat的语句是:__________________。
- 如果SqlConnection对象为conn,SqlCommand对象为cmd,请写出将cmd的连接属性设置为conn的代码:______
- 建立一个Connection对象的正确方法是( )。 A: Dim conn As ADODB.Connection conn=ADODB.Connection B: Dim conn As ADODB.Connection Set conn=New ADODB.Connection C: Dim conn As ADODB.Connection Set conn=ADODB.Connection D: Dim conn As Connection Set conn=New Connection