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..!!
My Question is..
What value is being assigned to integer variable count in int count = st.executeUpdate(query);
What does it assigns after it deleted all the rows..
and what does it assigns if there are already 0 rows in my table and no rows are deleted..?
Detailed explanation is much appreciated.
P.S. noob here