我想刪除數據庫中包含.jpg擴展名所在URL的所有行!無法在SQL Server 2008 R2上執行(DELETE)查詢
我使用
try{
java.sql.Statement mystat=connection.createStatement();
String delete_jpg="DELETE FROM mytable WHERE mycol LIKE '%.jpg%' ";
mystat.executeUpdate(delete_jpg);
}catch(Exception e){
}
執行使用Java JDBC此查詢給出了完全沒有錯誤,但它不刪除行的!請有人告訴我,我做錯了,請!
示例網址是:
images/affiliation-logo4.png HTTP/1.1
images/661.jpg HTTP/1.1
footerslider/images/blue-left-arrow.png HTTP/1.1
footerslider/images/blue-right-arrow.png HTTP/1.1
media/contentHeader/32.jpg HTTP/1.1 //I want to delete this type of rows
index.php?option=com_content&task=view&id=543 HTTP/1.1
images/favic.ico HTTP/1.1
src/ HTTP/1.0
uiit/faculty.php?dept_id=31 HTTP/1.1
uims/faculty.php?dept_id=32 HTTP/1.1
media/profile/dhS1t8X.jpg HTTP/1.1 //I want to delete this type of rows
media/profile/SSbkpgG.jpg HTTP/1.1 //I want to delete this type of rows
交易是否可能回滾?向我們展示如何執行查詢。 –
您是否在刪除後提交? – JHS
向我們展示Java代碼 – NINCOMPOOP