0
我想打電話給其一個參數是sqlstructure
型MS SQL.I已通過String[] array
一個存儲過程傳遞結構數據類型爲MS SQL數據庫,但它拋出該異常
如何從Java
WARNING: #{reportingCharts.getGraphValuesOnLocationBasis}: org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [{CALL dbo.up_Chart_SelectPersonCountByRankLocation(?,?,?,?,?)}]; SQL state [null]; error code [0]; The conversion from UNKNOWN to UNKNOWN is unsupported.; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: The conversion from UNKNOWN to UNKNOWN is unsupported.
javax.faces.FacesException: #{reportingCharts.getGraphValuesOnLocationBasis}: org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [{CALL dbo.up_Chart_SelectPersonCountByRankLocation(?,?,?,?,?)}]; SQL state [null]; error code [0]; The conversion from UNKNOWN to UNKNOWN is unsupported.; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: The conversion from UNKNOWN to UNKNOWN is unsupported.
所以我認爲它不接受array
作爲結構參數。
不幸的是,我無法找到關於如何在java中使用它的示例。
如何將我的這個數組/列表傳遞給這個存儲過程?或者什麼是C#SqlDbType.Structured
在java中的替代?
我不是Java程序員,但可能會有所幫助:JDBC具有單獨的ARRAY(java.sql.Array)和STRUCT(java.sql.Struct)數據類型。從另一方面來說 - 我不確定SQL Server能否接受來自JDBC的結構。 – Kamil
http://stackoverflow.com/questions/9375553/how-to-pass-userdefined-table-type-to-mssql-request-from-java可能的重複 – khan