A little doubt about Java calling SQLServer stored procedures


The Java program calls the stored procedure of SQL Server. As can be seen from the log, an exception was encountered during the execution of the stored procedure, but through the log of the execution of the stored procedure, it was still completely executed, and it was not interrupted by an exception thrown in the middle. .

The stored procedure is manually called again in the database connection tool, and the intermediate exception SQL is found only when the intermediate SQL to be executed is printed, and the stored procedure is also interrupted at the point where the abnormal SQL is executed.

2013-08-15 01:00:00,015 INFO - <======================== Acquisition program started: 1> [com.lh
lm.service.CollectService]
2013-08-15 01:08:09,609 ERROR - <collection program aborted: CallableStatementCallback; S
QL [{call pro_up2tmp(?)}]; Implicit conversion from datatype datetime to int is not allowed. please use C
ONVERT function to run this query. ; nested exception is java.sql.SQLException: subscript not allowed
Implicit conversion of type datetime to int. Please use the CONVERT function to run this query. > [com.lhlm.
service.CollectService]
org.springframework.dao.DataIntegrityViolationException: CallableStatementCallba
ck; SQL [{call pro_up2tmp(?)}]; Implicit conversion from datatype datetime to int is not allowed. Please
Use the CONVERT function to run this query. ; nested exception is java.sql.SQLException: not allowed
Allows implicit conversion from datatype datetime to int. Please use the CONVERT function to run this query.
        at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTra
nslate(SQLStateSQLExceptionTranslator.java:101)
        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslat
or.translate(AbstractFallbackSQLExceptionTranslator.java:72)
        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslat
or.translate(AbstractFallbackSQLExceptionTranslator.java:80)
        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslat
or.translate(AbstractFallbackSQLExceptionTranslator.java:80)

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326943513&siteId=291194637