public class StudentServiceImpl implements StudentService {
private StudentDao studentDao;
//使用set注入
public void setStudentDao(StudentDao studentDao) {
this.studentDao = studentDao;
}
@Override
public int addStudent(Student student) {
int num = studentDao.insertStudent(student);
return num;
}
@Override
public List queryStudents() {
List students = studentDao.selectStudent();
return students;
}
}
public class Test {
@org.junit.Test
public void serviceTestInsert(){
String config = "applicationContext.xml";
ApplicationContext ctx = new ClassPathXmlApplicationContext(config);
//获取容器中的dao对象
StudentService service = (StudentService) ctx.getBean("studentService");
Student student = new Student();
student.setId(10);
student.setName("马华");
student.setSex("女");
int num = service.addStudent(student);
System.out.println("成功插入条数:" + num );
}
}
1. If语句作为表达式
val properties = if (jobIdToActiveJob.contains(jobId)) {
jobIdToActiveJob(stage.jobId).properties
} else {
// this stage will be assigned to "default" po
基础测试题
卷面上不能出现任何的涂写文字,所有的答案要求写在答题纸上,考卷不得带走。
选择题
1、 What will happen when you attempt to compile and run the following code? (3)
public class Static {
static {
int x = 5; // 在static内有效
}
st
表里的一行对于一个数据块太大的情况有二种(一行在一个数据块里放不下)
第一种情况:
INSERT的时候,INSERT时候行的大小就超一个块的大小。Oracle把这行的数据存储在一连串的数据块里(Oracle Stores the data for the row in a chain of data blocks),这种情况称为行链接(Row Chain),一般不可避免(除非使用更大的数据
Follow up for "Remove Duplicates":What if duplicates are allowed at most twice?
For example,Given sorted array nums = [1,1,1,2,2,3],
Your function should return length