2012-11-15 32 views
1

當通過java調用時,sql lite中的更新語句返回什麼樣的值?它是布爾值嗎?在sqlite中更新語句的返回值

我想更新幾行,並想要獲取它是否正常工作或拋出異常。

在此先感謝

回答

1

試試這個:

1) 你在哪裏執行更新查詢的方法:

public boolean updateTable() 
{ 

boolean isSuccessFul = false; 
// Prepare the statements and the connections 

try 
{ 
// Execute the update 

isSuccessFul = true; 
} 
catch(Exception e) 
{ 
// Handle it 
} 
finally 
{ 
return isSuccessFul; 
} 
} 
1

如果使用iOS上運行了一句你得到的數行修改後,我覺得在Java中會類似