面试题
- 存储过程与存储函数与java代码的联系用法?
视图就是封装了一条复杂查询的语句。
语法1.:CREATE VIEW 视图名称 AS 子查询
范例:建立一个视图,此视图包括了20部门的全部员工信息
create view empvd20 as select * from emp t where t.deptno = 20
视图创建完毕就可以使用视图来查询,查询出来的都是20部门的员工
存储过程(Stored Procedure)是在大型数据库系统中,一组为了完成特定功能的SQL 语句集,经编译后存储在数据库中,用户通过指定存储过程的名字并给出参数(如果该存储过程带有参数)来执行它。存储过程是数据库中的一个重要对象,任何一个设计良好的数据库应用程序都应该用到存储过程。
一般来讲,过程和函数的区别在于函数可以有一个返回值;而过程没有返回值。
但过程和函数都可以通过out指定一个或多个输出参数。我们可以利用out参数,在过程和函数中实现返回多个值。
- FastDFS的方法的参数有什么?
method:'POST',
url:'../upload/uploadFile',
data:formData,
headers: {'Content-Type':undefined}, // ‘Content-Type’: undefined,这样浏览器会帮我们把 Content-Type 设置为 multipart/form-data
transformRequest: angular.identity// transformRequest: angular.identity ,anjularjs transformRequest function 将序列化我们的formdata object.
- 定时任务Quartz?
cron表达式用于配置cronTrigger的实例。cron表达式实际上是由七个子表达式组成。这些表达式之间用空格分隔。
1.Seconds (秒)
2.Minutes(分)
3.Hours(小时)
4.Day-of-Month (天)
5.Month(月)
6.Day-of-Week (周)
7.Year(年)
例:"0 0 12 ? * WED” 意思是:每个星期三的中午12点执行。
个别子表达式可以包含范围或者列表。例如:上面例子中的WED可以换成"MON-FRI","MON,WED,FRI",甚至"MON-WED,SAT"。
子表达式范围:
1.Seconds (0~59)
2.Minutes (0~59)
3.Hours (0~23)
4.Day-of-Month (1~31,但是要注意有些月份没有31天)
5.Month (0~11,或者"JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV,DEC")
6.Day-of-Week (1~7,1=SUN 或者"SUN, MON, TUE, WED, THU, FRI, SAT”)
7.Year (1970~2099)
- MQ有几个参数?
生产者、消费者、服务者、监控者。
5.weblogic 与JBOOS与tomcate。
6.表名username,字段名:uname,步长:5
写出该表中姓张的所有信息,展示第8页的信息。
用mysql与oracle来写出对应的sql语句。
mysql: select * from uname where username like '张&';
oracle:
如下解释:
oracle中Rownum表示行号,实际上此是一个伪劣,此列可以在每张表中出现。
范例:查询emp 表中带有rownum列:
select rownum, t.* from emp t
我们可以根据rownum来取结果集的前几行,比如前5行:
select rownum, t .* from emp t where rownum <6;
但是我们不能取到中间几行,因为rownum不支持大于号,只支持小于号,如果想实现我们需求怎么办?
答案是使用子查询,也正是oracle分页的做法。
select * from (select rownum r ,emp.* from emp) b
where b.r>5 and b.r <11;