生成插入语句的java程序应用于商品日期表1
发布日期:2021-06-29 16:59:02 浏览次数:2 分类:技术文章

本文共 1990 字,大约阅读时间需要 6 分钟。

import java.text.DecimalFormat;//生成插入语句的java程序应用于商品日期表public class demo2 {    public static void main(String[] args) {        //五月        for (int i=1;i<=31;i++){            double a=Math.random()*1000;            DecimalFormat df = new DecimalFormat( "0.00" );            String str=df.format( a );            System.out.println("INSERT INTO `productdate` VALUES ('202105002"+i+"', '2', '2021-05-"+i+"', "+str+", 1);");        }        //六月        for (int i=1;i<=30;i++){            double a=Math.random()*1000;            DecimalFormat df = new DecimalFormat( "0.00" );            String str=df.format( a );            System.out.println("INSERT INTO `productdate` VALUES ('202106002"+i+"', '2', '2021-06-"+i+"', "+str+", 1);");        }        //七月        for (int i=1;i<=31;i++){            double a=Math.random()*1000;            DecimalFormat df = new DecimalFormat( "0.00" );            String str=df.format( a );            System.out.println("INSERT INTO `productdate` VALUES ('202107002"+i+"', '2', '2021-07-"+i+"', "+str+", 1);");        }        //八月        for (int i=1;i<=31;i++){            double a=Math.random()*1000;            DecimalFormat df = new DecimalFormat( "0.00" );            String str=df.format( a );            System.out.println("INSERT INTO `productdate` VALUES ('202108002"+i+"', '2', '2021-08-"+i+"', "+str+", 1);");        }        //九月        for (int i=1;i<=30;i++){            double a=Math.random()*1000;            DecimalFormat df = new DecimalFormat( "0.00" );            String str=df.format( a );            System.out.println("INSERT INTO `productdate` VALUES ('202109002"+i+"', '2', '2021-09-"+i+"', "+str+", 1);");        }        //十月        for (int i=1;i<=31;i++){            double a=Math.random()*1000;            DecimalFormat df = new DecimalFormat( "0.00" );            String str=df.format( a );            System.out.println("INSERT INTO `productdate` VALUES ('202110002"+i+"', '2', '2021-10-"+i+"', "+str+", 1);");        }    }}

 

转载地址:https://superman.blog.csdn.net/article/details/117388887 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:boost::math::relative_difference相关用法的测试程序
下一篇:BOOST_CONSTANTS_GENERATE宏相关用法的测试程序

发表评论

最新留言

路过,博主的博客真漂亮。。
[***.116.15.85]2024年04月21日 06时56分44秒