java怎么插入oracle数据库timenstamp_Oracle数据库,数据库字段类型是 Timestamp(6),dao.query()报错,如何解决?...

nutz 1.r.66,数据库 Oracle

数据库字段类型:Timestamp(6),实体类字段类型 Date

@Column("OGG_TIMESTAMP")

private Date oggTimestamp;

dao 调用

List policyPlanList = dao.query(GpPolicyPlan.class, Cnd.where("POLICYNO", "=", "6310100990320160000019"));

报错信息

2020-07-02 17:07:44 [main] DEBUG org.nutz.dao.impl.sql.run.NutDaoExecutor -SELECT * FROM GPPOLICYPLAN WHERE POLICYNO=?

| 1 |

|------------------------|

| 6310100990320160000019 |

For example:> "SELECT * FROM GPPOLICYPLAN WHERE POLICYNO='6310100990320160000019'"

java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff]

at java.sql.Timestamp.valueOf(Timestamp.java:204)

at oracle.jdbc.driver.CharCommonAccessor.getTimestamp(CharCommonAccessor.java:544)

at oracle.jdbc.driver.T4CVarcharAccessor.getTimestamp(T4CVarcharAccessor.java:933)

at oracle.jdbc.driver.OracleResultSetImpl.getTimestamp(OracleResultSetImpl.java:1376)

at oracle.jdbc.driver.OracleResultSet.getTimestamp(OracleResultSet.java:512)

at com.zaxxer.hikari.pool.HikariProxyResultSet.getTimestamp(HikariProxyResultSet.java)

at org.nutz.dao.jdbc.Jdbcs$Adaptor$14.get(Jdbcs.java:572)

at org.nutz.dao.impl.entity.field.NutMappingField.injectValue(NutMappingField.java:89)

at org.nutz.dao.impl.entity.NutEntity.getObject(NutEntity.java:211)

at org.nutz.dao.impl.sql.pojo.PojoQueryEntityCallback$1.createObject(PojoQueryEntityCallback.java:24)

at org.nutz.dao.pager.ResultSetLooping.doLoop(ResultSetLooping.java:75)

at org.nutz.dao.impl.sql.pojo.PojoQueryEntityCallback.invoke(PojoQueryEntityCallback.java:28)

at org.nutz.dao.impl.jdbc.NutPojo.onAfter(NutPojo.java:114)

at org.nutz.dao.impl.sql.run.NutDaoExecutor._runSelect(NutDaoExecutor.java:277)

at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:53)

at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:66)

at org.nutz.dao.impl.interceptor.DaoLogInterceptor.filter(DaoLogInterceptor.java:22)

at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:64)

at org.nutz.dao.DaoInterceptorChain.invoke(DaoInterceptorChain.java:139)

at org.nutz.integration.spring.SpringDaoRunner._run(SpringDaoRunner.java:18)

at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:82)

at org.nutz.dao.impl.DaoSupport.run(DaoSupport.java:240)

at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:252)

at org.nutz.dao.impl.NutDao.query(NutDao.java:483)

at org.nutz.dao.impl.NutDao.query(NutDao.java:488)

at com.taikang.toolbox.datatransfer.DataTransferTest.testQueryInsert(DataTransferTest.java:100)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)

at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)

at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)

at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)

at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:74)

at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:84)

at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)

at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)

at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)

at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)

at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251)

at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)

at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)

at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)

at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)

at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)

at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)

at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)

at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)

at org.junit.runners.ParentRunner.run(ParentRunner.java:363)

at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)

at org.junit.runner.JUnitCore.run(JUnitCore.java:137)

at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)

at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)

at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)

at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

如何解决啊?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值