For DML (Data Manipulation Language) statements like update, insert, delete we use the method executeUpdate.
For select statement we use executeQuery which returns a ResultSet instance.
stu derby
Ranch Hand
Joined: Dec 15, 2005
Posts: 333
posted
0
Sort of yes.
There are times and ways you could use execute() instead, but for beginners (and for most of general purpose code), that's the way to do it.
Beginners should also start with using PreparedStatement, instead of Statement. Many people have the idea that Statement is easier, and therefore should be learned first, but Statement has all sorts of problems and really shouldn't be used much at all...
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.