你好,请帮我看下这个问题,谢谢。我用的1.60。用的这段代码:
Map<String,Object> map = new HashMap<String,Object>();
map.put(".table", "Entity_ZBJL");
map.put("uuid", UUID.randomUUID().toString());
map.put("muser", user);
map.put("x", x);
map.put("y", y);
map.put("jlsj", new Date());
dao.insert(map);
下面是后台日志:
2017-03-13 17:37:20,737 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - INSERT INTO Entity_ZBJL(muser,jlsj,uuid,y,x) VALUES(?,?,?,?,?)
| 1 | 2 | 3 | 4 | 5 |
|---|---------------------|--------------------------------------|------------|-------------|
| 7 | 2017-03-13 17:37:20 | f2147c47-e1d7-4ce9-95ed-8572ec875b17 | 45.6074318 | 84.86561041 |
For example:> "INSERT INTO Entity_ZBJL(muser,jlsj,uuid,y,x) VALUES(7,'2017-03-13 17:37:20','f2147c47-e1d7-4ce9-95ed-8572ec875b17','45.6074318','84.86561041') "
有时候能插入记录,有时候无法插入,可是又没有报错?
表结构是这样的:
CREATE TABLE "TLFDJGL"."ENTITY_ZBJL"
( "UUID" VARCHAR2(50 BYTE),
"MUSER" NUMBER(12,0),
"X" VARCHAR2(30 BYTE),
"Y" VARCHAR2(30 BYTE),
"JLSJ" DATE
)
dao.js是这样的:
var ioc = {
conf : {
type : "org.nutz.ioc.impl.PropertiesProxy",
fields : {
paths : ["custom/"]
}
},
dataSource : {
type : "com.alibaba.druid.pool.DruidDataSource",
events : {
create : "init",
depose : 'close'
},
fields : {
url : {java:"$conf.get('db.url')"},
username : {java:"$conf.get('db.username')"},
password : {java:"$conf.get('db.password')"},
testWhileIdle : true,
validationQuery : {java:"$conf.get('db.validationQuery')"},
maxActive : {java:"$conf.get('db.maxActive')"},
filters : "mergeStat",
connectionProperties : "druid.stat.slowSqlMillis=2000"
}
},
dao : {
type : "org.nutz.dao.impl.NutDao",
args : [{refer:"dataSource"}]
}
};
db.properties是这样的:
db.url=jdbc:oracle:thin:@127.0.0.1:1521/orcl
db.username=djgl
db.password=000000
db.validationQuery=select 1 from dual
db.maxActive=100