NutzCN Logo
问答 skip not key sql line 初始化数据库,读取sql文件,但获取不了数据
发布于 92天前 作者 herexu 170 次浏览 复制 上一个帖子 下一个帖子
标签:
 FileSqlManager fm = new FileSqlManager("dbtest/");
            List<Sql> sqlList = fm.createCombo(fm.keys());
            Sql[] sqls = sqlList.toArray(new Sql[sqlList.size()]);
            for (Sql sql : sqls) {
                dao.execute(sql);
            }
[DEBUG] 2019-01-18 18:50:09,589 org.nutz.resource.Scans.scan(Scans.java:280) - Found 1 resource by src( dbtest/ ) , regex( .(sql|sqlx|sqls)$ )
[DEBUG] 2019-01-18 18:50:09,590 org.nutz.dao.impl.FileSqlManager.refresh(FileSqlManager.java:59) - load >> TEST_ASSESS_ANNUAL.sql from root=dbtest/
[INFO ] 2019-01-18 18:50:09,591 org.nutz.dao.impl.FileSqlManager.add(FileSqlManager.java:116) - skip not key sql line INSERT INTO TEST.ASSESS_ANNUAL (ID, TITLE, YEAR, REMARKS, CREATION_TIME, STATE, OPBY, OPAT, DELFLAG) VALUES ('2484c8d359ec4fcfb8b0a33440100447', '2018年年度考核', '2018year', '2018年年度部门考核', '1547358403724', 'annual_selfReviewing', 'scshwhszhxxg_admin', '1547358403724', '0')
[DEBUG] 2019-01-18 18:50:09,591 org.nutz.dao.impl.FileSqlManager.refresh(FileSqlManager.java:66) - load 0 sql >> TEST_ASSESS_ANNUAL.sql from root=dbtest/

dbtest/底下只有个.sql文件

INSERT INTO TEST.ASSESS_ANNUAL (ID, TITLE, YEAR, REMARKS, CREATION_TIME, STATE, OPBY, OPAT, DELFLAG) VALUES ('2484c8d359ec4fcfb8b0a33440100447', '2018年年度考核', '2018year', '2018年年度部门考核', '1547358403724', 'annual_selfReviewing', 'scshwhszhxxg_admin', '1547358403724', '0');
1 回复

仔细看文档哦,自定义sql,格式有要求的

添加回复
请先登陆
回到顶部