B) @Trans C) @Session
D) @Transactional
22. 在Spring中使用Hibernate实现DAO层时,一般需要从( )
类继承,以简化DAO代码的书写。(选择一项) A) HibernateTemplate B) HibernateDao C) HibernateSupport D) HibernateDaoSupport 23. 在Oracle中,( )过程用来产生用户自定义错误消息。(选
择一项)
A) RAISE_ERROR B) SQLERRM
C) RAISE_APPLICATION_ERROR D) RAISE_SERVER_ERROR 24. 表(TEACHER)包含下列:( )(选择一项) ID NUMBER(7) PK SALARY NUMBER(7,2) SUBJECT_ID NUMBER(7) NOT NULL 判断以下两个SQL语句: (1) SELECT COUNT (DISTINCT SUBJECT_ID) FROM teacher; (2) SELECT COUNT (SUBJECT_ID) FROM teacher; 下列哪句是正确的:( ) A) 语句1将返回老师的总数 B) 语句2将返回老师的总数
C) 两句都返回老师的总数 D) 以上都不对 25. 在J2EE中,使用( )选项中的代码,可以生成如下XML
文档:(选择两项) <PEOPLE> <PERSON>
<NAME>Tony Blair</NAME> </PERSON> <PEOPLE>
A) Element people=doc.createElement(“PEOPLE”);
Element person=doc.createElement(“PERSON”); Element name=doc.createElement(“NAME”);
name.appendChild(doc.createTextNode(“Tony Blair”)); people.appendChild(person); person.appendChild(name); doc.appendChild(people);
B) Element people=doc.createElement(“PEOPLE”);
Element person=doc.createElement(“PERSON”); people.appendChild(person);
Element name=doc.createElement(“NAME”);
name.appendChild(doc.createTextNode(“Tony Blair”)); person.appendChild(name); doc.appendChild(people);
C) Element people=doc.createElement(“PEOPLE”);
Element person=doc.createElement(“PERSON”); people.appendChild(person);
Element name=doc.createElement(“NAME”);
name.appendText(doc.createTextNode(“Tony Blair”)); person.appendChild(name); doc.appendChild(people);
D) Element people=doc.createElement(“PEOPLE”);
Element person=doc.createElement(“PERSON”); Element name=doc.createElement(“NAME”); name.appendTextNode(“Tony Blair”); people.appendChild(person); person.appendChild(name); doc.appendChild(people);
26. 在如下的Schema片段中定义了一个数据类型 LocationType:
<xs:complexType name=”LocationType”> <xs:choice>
<xs:element name=”description” type=”xs:string”/> <xs:element name=”place” type=”xs:string”/> </xs:choice> </xs:complexType>
那么下面的XML文档实例片段中符合该 Schema定义的是( )。(选择一项) A) <LocationType>
<description>Hello</description> <place>USA</place> </LocationType>
5