2016-08-16 43 views
0

我有執行使用hibernate SessionFactory的在Java應用程序下面的T-SQL腳本的問題,但是,這個SQL代碼的工作,當我在PostgreSQL中運行:休眠數據異常(Java Web應用程序)

​​

以下是從Eclipse控制檯錯誤:

* ERROR 2016-08-16 11:36:18,753 No value specified for parameter 1. (SqlExceptionHelper.java [qtp1843774775-20]) 
* ERROR 2016-08-16 11:36:18,760 Error while executing action (ExceptionInterceptor.java [qtp1843774775-20]) 
org.hibernate.exception.DataException: could not execute statement 
at  org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:135) 
at  org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) 
at  org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:124) 


Caused by: org.postgresql.util.PSQLException: No value specified for parameter 1. 
at  org.postgresql.core.v3.SimpleParameterList.checkAllParametersSet(SimpleParameterList.java:225) 
at  org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:190) 
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:424) 
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:161) 
at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:133) 
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105) 
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:186) 
... 124 more 
+0

起始分號似乎很奇怪;你可以嘗試沒有它? –

+0

是的,我累了,但它沒有奏效。 – Sulton

回答

1

運行時通過Java這個SQL,還有::鑄造的 「誤解」。

請用'[^0-9]*' ,'0')\\:\\:integer替換'[^0-9]*' ,'0')::integer,它應該工作。

+0

它的工作,非常感謝)) – Sulton