首页 > 考试题库
题目内容 (请给出正确答案)
[主观题]

分析以下代码。public static void test(string ConnectString) { System.Data.OleDb.Ole

分析以下代码。

public static void test(string ConnectString)

{

System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection();

conn.ConnectionString = ConnectString;

try

{

conn.Open();

…….

}

catch(Exception Ex)

{

MessageBox.Show(Ex.ToString());

}

finally

{

if (!conn.State.Equals(ConnectionState.Closed))

conn.Close();

}

}

请问

1)以上代码可以正确使用连接池吗?

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“分析以下代码。public static void test…”相关的问题
第1题
下列代码的执行结果是:()public class Test3{public static void main(String args[]){System.ou

A.1,1

B.1,1.0

C.1.0,1

D.1.0,1.0

点击查看答案
第2题
public static const int A=1;这段代码有错误么?是什么?

点击查看答案
第3题
给出下面代码的输出()public class Test {public static void main(String[ ] args) {int[][]

A.0

B.1

C.2

D.4

点击查看答案
第4题
程序改错class mml{private:static unsigned int x;public:mml(){ x++; }mml(static unsigned

程序改错

class mml

{

private:

static unsigned int x;

public:

mml(){ x++; }

mml(static unsigned int &) {x++;}

~mml{x--;}

pulic:

virtual mon() {} = 0;

static unsigned int mmc(){return x;}

......

};

class nnl:public mml

{

private:

static unsigned int y;

public:

nnl(){ x++; }

nnl(static unsigned int &) {x++;}

~nnl{x--;}

public:

virtual mon() {};

static unsigned int nnc(){return y;}

......

};

代码片断:

mml* pp = new nnl;

..........

delete pp;

点击查看答案
第5题
写出以下程序的运行结果

class A

{

int a;

A(int b)

{a=b;}

void show()

{System.out.println(“a=”+a);}

}

public class Class1

{

public static void main (String args[])

{

A bj=new A(12345);

boolean b=false;

char ch=97;

obj.show();

System.out.println(“b=”+b+”/tch=”+ch);

}

}

点击查看答案
第6题
写出以下程序的运行结果。public class Test2 {public static void main(String args[ ]){int i,j

写出以下程序的运行结果。public class Test2 {public static void main(String args[ ]){int i,j;int a[]={17,91,65,35,28};for (i = 0; i < a.length-1; i++ ) {int k = i;for(j = i; j < a.length; j++ )if (a[j]>a[k] )k = j;int temp =a[i];a[i] = a[k];a[k] = temp;}for (i =0; i<a.length; i++ )System.out.print(a[i]+" ");System.out.println();} }

点击查看答案
第7题
以下关于方法声明中正确的是()

A.public final writeLog(String msg)

B.public final abstract void writeLog(String msg)

C.public static final void writeLog(String msg)

D.public static abstract void writeLog(String msg)

点击查看答案
第8题
以下程序的运行结果为()public class IfTest{public static void main(String args[]){int x=3;

A.Not equal

B.Equal

C.无输出

D.编译出错

点击查看答案
第9题
class A{public static int max(int a,int b){return a>b?a:b;}public static void main(Stri
class A{public static int max(int a,int b){return a>b?a:b;}public static void main(Stri

class A{

public static int max(int a,int b){

return a>b?a:b;

}

public static void main(String args[]){

System.out.println(“max=”+max(5,23));

}

}

点击查看答案
第10题
程序阅读:public class test{public static void main(String argv[]){boolean b1 = true;if((

程序阅读:public class test

{

public static void main(String argv[])

{

boolean b1 = true;

if((b1 ==true) || place(true))

{

System.out.println("Hello Crowle");

}

}

public static boolean place(boolean location)

{

if(location==true)

{

System.out.println("Borcetshire");

}

System.out.println("Powick");

return true;

}

}

点击查看答案
退出 登录/注册
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改