import java.sql.*;
class ConnectionTest {
public static void main(String... args)throws Exception {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("Jdbc:Odbc:myjdbc1", "sri", "tiger");
System.out.println(con);
Statement st = con.createStatement();
System.out.println(st);
String query = "delete logindetails";
int count = st.executeUpdate(query);
if(count == 0)
System.out.println("no records to delete");
else
System.out.println("deleted successfullly");
con.close();
}
}
Hello World .. !! 我的問題是.. 被賦予什麼樣的價值整數變量count
在int count = st.executeUpdate(query);
這是什麼分配後,刪除所有的行..
的,什麼是它分配如果已經有0行我的表中,沒有行被刪除..?JDBC聲明接口 - executeUpdate查詢
詳細的解釋是非常感謝。
P.S.小白這裏
http://stackoverflow.com/questions/12400985/what-does-it-mean-when-statement-executeupdate-returns-1 – Maroun 2013-04-20 13:52:11