leslie26
- 浏览: 3339 次
- 性别:
最近访客
社区版块
- ( 0)
- ( 0)
- ( 0)
最新评论
文章列表
- 博客分类:
java获取当月第一天
public static string getfirstday() {
simpledateformat df = new simpledateformat("yyyy-mm-dd");
calendar calendar = calendar.getinstance();
date thedate = calendar.gettime();
gregoriancalendar gclast = (gregoriancalendar) calendar.getinstance ...
- 2023-05-25 17:33
- 浏览 266
- 分类:编程语言
- 博客分类:
多表连接查询条件中,判断字符串长度后是否拼接作为条件
select * from t_eds z left join t_causer b
on case when length(z.signature)=3 then '0'||z.signature else z.signature end = b.usercode
- 2023-05-25 11:23
- 浏览 127
- 分类:数据库
- 博客分类:
想获取前几天的日期,替换数字。
select to_char((sysdate-interval '5' day),'yyyy-mm-dd') from dual;
- 2023-05-24 16:52
- 浏览 314
- 分类:数据库
- 博客分类:
mysql循环插入数据:id已经添加随机数(可以批量插入测试数据,省的一个一个的麻烦。)
drop procedure if exists proc_initdata;
delimiter $
create procedure proc_initdata()
begin
declare i int default 1;
while i<=50 do -- 修改成你打算插入的数据条数
insert into `project` values (concat("项目名称", ceiling(rand() * 9000 1 ...
- 2023-05-23 14:38
- 浏览 252
- 分类:数据库
- 博客分类:
delimiter $$
create function rs(n int)
returns varchar(1024)
begin
declare chars char(62) default 'abcdefghijklmnopqrstuvwxyzabcdefjhijklmnopqrstuvwxyz0123456789';
declare res varchar(1024) default '';
declare i int default 0;
repeat
set i = i 1;
set res = concat(res,substring(chars,floo ...
- 2023-05-23 14:28
- 浏览 133
- 分类:数据库
- 博客分类:
public string getnumid() {
simpledateformat sdf = new simpledateformat("yyyymmddhhmmss");
date now = new date();
string nowstring = sdf.format(now);
random random = new random();
int rannum = (int) (random.nextdouble() * (99999 - 10000 1)) 10000;
re ...
- 2021-09-13 15:17
- 浏览 256
- 分类:互联网
- 博客分类:
/**
* 获取随机数4位
* @return
*/
public static string getrandomnumber(){
stringbuffer buffer = new stringbuffer();
for(int i = 0; i < 4; i ){
int num = (int) (math.random() * 10);
buffer.append(num);
}
return buffer.tostring();
}
- 2021-09-13 14:29
- 浏览 667
- 分类:互联网
- 博客分类:
/**
* 向文件中写入内容
* @param file
* @param content
* @param addflag
* @throws utilexception
*/
public static void addcontenttofile(file file,string content,boolean addflag) throws utilexception{
try {
// simpledateformat sdf = new simpledateformat("yyyy-mm-dd hh:mm:ss ...
- 2021-09-13 14:19
- 浏览 317
- 分类:互联网
- 博客分类:
/**
* 获取文件大小 单位m
* @param file
* @return
* @throws utilexception
*/
public static double getfilesize(file file) throws utilexception{
try {
double size=0;
if (file.exists()) {
fileinputstream fis = null;
fis = new fileinputstream(file);
...
- 2021-09-13 14:17
- 浏览 615
- 分类:互联网
- 博客分类:
public static void main(string[] args) {
int randommax = 999999;
int randommin = 100000;
int radomint = randommin new random().nextint(randommax - randommin);
system.out.println(radomint);
int radomint2 = new random().nextint(99999);
system.out.println(radomint2);
}
- 2021-09-13 11:56
- 浏览 392
- 分类:互联网