有事点这里!

当前位置: 首页 >> IT技术 >> 面试大全 >> 中软面试题

中软面试题

[ 来自:不祥 作者:网络收集 阅读:0 时间:2008-2-2 23:21:50 ]

收集了一些中软的面试题:

1 写一个servlet,实现以下功能:已知数据源JNDI地址为“jdbc/db2DataSource”,请用这个名字获得数据库连接,并执行SQL:“SELECT A,B FROM MYTABLE”,把执行结果输出到文本文件“out.txt”,并将请求转发到“/application/test.jsp”

da:

Context initContext = new InitialContext();
Context envContext = (Context)initContext.lookup("java:/comp/env");
DataSource ds = (DataSource)envContext.lookup("jdbc/db2DataSource");
Connection conn = ds.getConnection();
//etc.在tomcat中,获取jdni资源的方法是java:/comp/env/定义的名字,在weblogic中直接使用定义的名字就可以找到,在jboss和websphere中,则使用java:定义的jndi名字即可。 2 链表逆序问题

冒泡法排序函数:

思想是什么?
void bubble(int a[],int n)
{
int i,j,k;
for(i=1,i<n;i++)
for(j=0;j<n-i;j++) [j]>a[j+1])
{
k=a[j];
a[j]=a[j+1];
a[j+1]=k;
} }
ATM测试怎么测试ATM机?

出栈入栈怎么测试和解决网络故障
还有个程序涉及到栈的问题?

什么是网络故障测试?
3 简答题.

1.避免死锁的方法有哪些?

2.Sybase数据库中注册用户与数据库用户有什么区别?

3.MS SQL_Server 数据库中通过什么约束保证数据库的实体完整性

4.内存有哪几种存储组织结构.请分别加以说明

5.JAVA中的Wait() notify()方法使用时应注意些什么?

6.用户输入一个整数.系统判断,并输出是负数还是非负数,请设计测试用例.

7.操作系统中的同步和互诉解决了什么问题

8.UNIX init

二.编写类String 的构造函数,析构函数和赋值函数

已知类String 的原型为

class string

{

public:

string(const char *str=null);//普通构造函数

string(const string &other);//拷贝构造函数

---string(void);

string &operate=(const string &other);//赋值函数

private:

char * m-data;//用于保存字符串

};

请编写string 的上述4个函数

三.有关内存的思考题

1.void getmemory(char *p)

{ p=(char*)mallol(100);

}

void test(void)

{

char * str =null;

getmemory(str);

strcpy(str,”hello,world”);

printf(str);

}

请问运行Test函数会有什么样的结果

2.char*getmemory(void)

{ char p[]=”hello world”;

return p;

}

void test(void)

{

char *str=null;

str=Getmemory();

printf(str);

}请问运行Test 函数会有什么样的结果.

4 写一个函数生成一个四位的随机数,而且要四位数中的每一位数字不相同 语言不限..........

答:public int generatorInt(){
int[] array={0,1,2,3,4,5,6,7,8,9};
Random rdm=new Random();
int number=0;
int tep=10;
int base=1000;
boolean first=true;
for(int j=0;j<4;j++){
int i;
if(first){
i=rdm.nextInt(--tep)+1;
number+=array[i]*base;
array[i]=array[tep];
first=false;
}else{
i=rdm.nextInt(tep);
number+=array[i]*base;
array[i]=array[--tep];
}
base/=10;
}
return number;
}

奥运您知道

动漫情报

影视广场

IT技术

相关文章

QQCAT(www.qqcat.com),资源信息,免费观看。本站所有信息均来自网上,如损害到您的利益,请及时联系我们!
QQCAT版权所有©2007