--concat连接两个字符串
select concat('hello',' world') from dual;
--instr返回c2在c1次出现的位置,从i开始搜
select instr('Messississiq','i',3,2) from dual;
--保留参数,不四舍五入
select trunc(1234.567,2) from dual;--不四舍五入
--取余数
select mod(13,3) from dual;
Java-MyEclipseGen-培训班
package EclipseGen;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class MyEclipseGen {
private static final String LL = "Decompiling this copyrighted software is a violation of both your license agreement and the Digital Millenium Copyright Act of 1998 (http://www.loc.gov/copyright/legislation/dmca.pdf). Under section 1204 of the DMCA, penalties range up to a $500,000 fine or up to five years imprisonment for a first offense. Think about it; pay for a license, avoid prosecution, and feel better about yourself.";
public String getSerial(String userId, String licenseNum) {
java.util.Calendar cal = java.util.Calendar.getInstance();
cal.add(1, 3);
cal.add(6, -1);
java.text.NumberFormat nf = new java.text.DecimalFormat("000");
licenseNum = nf.format(Integer.valueOf(licenseNum));
String verTime = new StringBuilder("-").append(
new java.text.SimpleDateFormat("yyMMdd").format(cal.getTime()))
.append("0").toString();
Java注解讲义-培训班
深入理解Java:注解(Annotation)自定义注解入门
要深入学习注解,我们就必须能定义自己的注解,并使用注解,在定义自己的注解之前,我们就必须要了解Java为我们提供的元注解和相关定义注解的语法。
________________________________________
元注解:
元注解的作用就是负责注解其他注解。Java5.0定义了4个标准的meta-annotation类型,它们被用来提供对其它 annotation类型作说明。Java5.0定义的元注解:
1.@Target,
2.@Retention,
3.@Documented,
4.@Inherited
这些类型和它们所支持的类在java.lang.annotation包中可以找到。下面我们看一下每个元注解的作用和相应分参数的使用说明。
Oracle查询一-培训班
select * from student;
--别名(为字段取一个临时的名称)
select s_name as "姓名",s_age as "年龄",c_id as "班级"
from student;
--两表查询,消除笛卡尔积,并为字段取别名
select s.s_name as "姓名",s.s_age as "年龄",
c.c_name as "班级" from student s,sclass c
where s.c_id=c.c_id;
--连接符号,用于数据库查询时将查询的字段连接在一起
select s.s_name||','||s.s_age||','||c.c_name from
student s,sclass c where s.c_id=c.c_id;
--排序order by(将需要用顺序排列的字段放到order by后面)
select * from student order by s_age desc;
Java修饰符总结-培训班
Java中修饰符总结:
1. 访问控制修饰符
作用: 用于控制被修饰变量、方法、类的可见范围.
public 的访问级别是最高的,其次是 protected、默认和 private.
成员变量和成员方法可以处于4个访问级别中的一个:公开、受保护、默认或私有.
存在继承关系时,父类不可以是 private,因为子类无法继承
顶层类可以处于公开或默认级别,顶层类不能被 protected 和 private 修饰.
局部变量不能被访问控制修饰符修饰 .
下图是在不同情况下各种权限修饰符的作用范围: