java.sql.SQLException: ORA-01830: date format picture ends before converting ent

java.sql.SQLException: ORA-01830: date format picture ends before converting ent
ire input string

        at oracle.jdbc.driver.DatabaseError.throwSqlException(Ljava.lang.String;
Ljava.lang.String;I)V(DatabaseError.java:125)
        at oracle.jdbc.driver.T4CTTIoer.processError(Z)V(T4CTTIoer.java:305)
        at oracle.jdbc.driver.T4CTTIoer.processError()V(T4CTTIoer.java:272)
        at oracle.jdbc.driver.T4C8Oall.receive()V(T4C8Oall.java:623)
        at oracle.jdbc.driver.T4CPreparedStatement.doOall8(ZZZZ)V(T4CPreparedSta
tement.java:181)
        at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(Z)V(T4CPrepa
redStatement.java:543)
        at oracle.jdbc.driver.OracleStatement.execute_maybe_describe()V(OracleSt
atement.java:913)
        at oracle.jdbc.driver.T4CPreparedStatement.execute_maybe_describe()V(T4C
PreparedStatement.java:452)
        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout()V(OracleStat
ement.java:984)
        at oracle.jdbc.driver.OraclePreparedStatement.executeInternal()I(OracleP
reparedStatement.java:2885)
        at oracle.jdbc.driver.OraclePreparedStatement.executeQuery()Ljava.sql.Re
sultSet;(OraclePreparedStatement.java:2926)
        at weblogic.jdbc.wrapper.PreparedStatement.executeQuery()Ljava.sql.Resul
tSet;(PreparedStatement.java:124)
        at com.wss.user.session.UserManagerEJB.updateBuyerUserInfo(Lcom.wss.user
.general.UserDTListInfo;)Ljava.lang.String;(Unknown Source)
        at com.wss.user.session.UserManagerEJB_kyi0c6_EOImpl.updateBuyerUserInfo
(Lcom.wss.user.general.UserDTListInfo;)Ljava.lang.String;(UserManagerEJB_kyi0c6_
EOImpl.java:46)

...

原因:数据表的日期格式问题,如2007-07-05 10:29:53.0 多了一个".0"解决的办法是先在查询的时候用to_char()然后在用to_date()转换.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值