常用时间和日期类型的使用
1.time类型
create table TimeEx
(
start_time time
);
insert into TimeEx values('13:30:00');
select * from TimeEx;
2.datetime类型
create table DateTimeEx
(
start_time datetime
);
insert into DateTimeEx values('2010-8-2 13:30:00');
select * from DateTimeEx;
3.date类型
create table DateEx
(
start_time date
);
insert into DateEx values('2010-8-2');
select * from DateEx;
4.year类型
create table YearEx
(
start_time year
);
insert into YearEx values('1987');
select * from YearEx;
查看用户:select user();
查看当前用户:select current_user();
输出结果为乱码问题:
while(rs.next())
{
String[] temp=new String[1];
temp[0]=new String(rs.getString(1).getBytes("ISO-8859-1"));
list.add(temp);
}