import
java.text.SimpleDateFormat;
import
java.util.Calendar;
import
java.util.Date;
public class DateTestUtil
{
public
static void main(String[] args) throws Exception {
SimpleDateFormat sdf=new
SimpleDateFormat('yyyyMMdd');
String str='20110823';
1. 创建表zuocheng
create table zuocheng(id int ,address char(25), pay
int);
2. 创建自增序列
create sequence zc //创建名为zc的序列
increment by 1
//自增长度为1
start with 1 //从1开始计数
minvalue 1 //最小值为1
nomaxvalue //没有最大值
nocache; //不设置缓存
3. 为表zuocheng创建触发器
create or replace trigger zuocheng_id //将触发器绑定在 id 这一列
before insert
on zuocheng
for each row
when(new.id is null)
begin
select zc.nextval into: