> I was looking at the wrong place for EVERYTHING till now I
> guess...Gerd, would you be so kind to explain to me as to what the
> difference is betweent the two sites above. I see 'beans' keyword
> extra in the site I was referring to.
They refer to two entirely different packages in Java.
This one ...
http://java.sun.com/j2se/1.4.2/docs/api/java/beans/Statement.html
is part of the documentation for the java.beans package, which contains
classes which encapsulate the Java Beans technology. If you're
unfamiliar with that term, you might want to browse the Java Beans tutorial:
http://java.sun.com/docs/books/tutorial/javabeans/
On the other hand, this link ...
http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Statement.html
is part of the documentation for the java.sql package, which (slightly
confusingly) provides classes for Java's JDBC (Java DataBase
Connectivity) technology. There's a good tutorial on JDBC here:
http://java.sun.com/docs/books/tutorial/jdbc/
Since you're working with JDBC, you need the docs for java.sql rather
than java.beans.
If you're hazy about the concept of packages in Java, here's a good
introduction:
http://java.sun.com/docs/books/tutorial/java/interpack/packages.html
Hope this helps.
David Harper
Cambridge, England
Raquel - 18 Jun 2004 08:17 GMT
Thank you so much David. Will go through the tutorials you recommend.
Regards,
Raquel.
oleg gerassimenko - 22 Jun 2004 15:06 GMT
Have a look at a PreparedStatement class which is a subclass of
Statement. It has an executeQuery() method for SELECT and
executeUpdate() for INSERT,UPDATE,DELETE statements.