《Web程序设计技术基础(J2EE)》期末试卷(A卷)_第1页
《Web程序设计技术基础(J2EE)》期末试卷(A卷)_第2页
《Web程序设计技术基础(J2EE)》期末试卷(A卷)_第3页
《Web程序设计技术基础(J2EE)》期末试卷(A卷)_第4页
《Web程序设计技术基础(J2EE)》期末试卷(A卷)_第5页
已阅读5页,还剩7页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、班级 姓名 学号 -密封线内不得答题-Web程序设计技术基础(J2EE)期末试卷(A卷)参考答案(开卷)考试用时:120分钟 总分:100分题 号一二三总 分得 分 得分阅卷人一、写出下列程序的运行结果(3*6,共18分)1. public class Test public static void main(String args) SubClass sb = new SubClass( ); System.out.println(sb.min( ); class SuperClass int a = 10 , b = 20 ; public SuperClass () System.out

2、.println(SuperClass Create); class SubClass extends SuperClass public SubClass () System.out.println(SubClass Create); int min( ) return (ab)?a:b); 运行结果:2. class Parent void printMe() System.out.println(parent); class Child extends Parent void printMe() System.out.println(child); void printAll() sup

3、er.printMe(); this.printMe(); printMe(); public class ClassTest public static void main(String args) Child myC = new Child( ); myC.printAll( ); 运行结果: 3.public class TestString public static void main(String args) String s1 = Hello!; String s2 = new String(World!); String s3=HelloJava, s4=HelloJava;

4、String s5=new String(s3); System.out.println(s1.concat(s2); System.out.println(s3=s4 is +(s3=s4); System.out.println(s3=s5 is +(s3=s5); 运行结果:4. class A static System.out.print(1); public A() System.out.print(2); class B extends A static System.out.print(a); public B() System.out.print(b); public cla

5、ss Hello public static void main(String ars)A ab = new B(); B b = new B();运行结果:5. public class TryCatchTest public static void main(String args ) int a=99,b=0,c; trySystem.out.println(产生异常之前);c=a/b; System.out.println(产生异常之后);catch(ArrayIndexOutOfBoundsException e) System.out.println(处理下标越界异常);catch

6、(ArithmeticException e) System.out.println(处理算术异常); System.out.println(异常处理结束); 运行结果:6. test.jsp JSP 页面 % for (int i=1; i 运行结果:得分阅卷人二、编程题(9+15+15+15,共62分)1编写Student.jsp,要求使用Struts标签,把学生信息(学号、姓名、性别、密码)保存到Oracle数据库中,编写Success.jsp,要求在页面上显示“学生信息保存成功!”请把两个JSP中和之间的内容补充完整(7+2,共9分)Student.jsp(7分) 请输入学生信息输入学

7、生信息: Success.jsp(2分) 学生信息插入成功2编写一个无状态SessionBean,远程接口名称叫StudentRemote,本地接口名称叫StudentLocal,实现类叫StudentBean。(3+2+10,共15分)StudentRemote.java(3分)StudentLocal.java(2分)StudentBean.java(要求实现把学生信息通过Hibernate,保存到Oracle数据库中去) (10分)3编写StudentAction.java(要求调用上面编写的无状态SessionBean,当调用成功时候,返回到Success.jsp页面,并编写两个配置文

8、件web.xml和Struts.xml,确保配置文件正确,实现正常的流程跳转。)(9+4+2,共15分)StudentAction.java(9分)Struts.xml(4分)web.xml(2分)4根据以下sql脚本文件的内容建立 Student 持久化类和对应的 student.hbm.xml 映射文件, 建立 hibernate.cfg.xml 文件。(4+5+6,共15分)CREATE TABLE Student(StuIdint not null Primary Key ,StuNameChar(10) ,StuPwdChar(20) ,StuSexChar(4) );Student.java (4分)student.hbm.xml(5分)hibernate.cfg.xml (6分)(假设当前数据库名称叫StuSys,系统管理员system,密码JYPC)得分阅卷人三、简答题(10+1

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论