@富士山下 2021-07-20 22:34 采纳率: 0%
浏览 290

数据插入数据库的时候报错, 但是数据库里面字段长度就不是1的


Caused by: org.postgresql.util.PSQLException: ERROR: value too long for type character(1)
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2455)
    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2155)
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:288)
    at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:430)
    at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:356)
    at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:168)
    at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:135)
    at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:98)
    at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:98)
    at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:133)
    ... 108 common frames omitted

  • 写回答

4条回答 默认 最新

  • Traveler∝゛过客 2021-07-20 23:56
    关注

    你数据库的表肯定不止一列吧, 你看看是不是你插入的时候没有对应好。

    评论

报告相同问题?

问题事件

  • 创建了问题 7月20日