CallableStatement call = conn
prepareCall(
{Call up_UserLogin(?
?
?
?)}
)
call
setString(
username)
call
setString(
password)
call
setString(
ip)
call
setString(
mac)
SQLQuery query = session
createSQLQuery(
{Call up_UserLogin(?
?
?
?)}
)
query
setString(
username)
query
setString(
password)
query
setString(
ip)
query
setString(
mac)
query
addScalar(
Hibernate
STRING)
query
addScalar(
Hibernate
INTEGER)
return query
list()
兩種方式調用存儲過程
第二種類型轉換不成功
使用的jdbc驅動是jtds
不知道什麼原因
From:http://tw.wingwit.com/Article/program/Java/ky/201311/28633.html