Java Reference
In-Depth Information
We haven't covered the basic Statement class suitable for fixed queries
with no parameters (instead we used PreparedStatement which will work
with or without parameters), nor have we discussed the CallableStatement
class for calling stored procedures in the database. With what you know now,
though, you should be able to glean enough information from the Javadoc
pages on these classes to do what you need, as they are similar to the
PreparedStatment class.
RowSets extend ResultSet to include mechanisms for listening for data
changes and for JavaBeans functionality. But again, Javadoc information or a
comprehensive book on the subject would be a good next step, now that you
have the basics in hand.
We haven't covered the ResultSetMetaData class, which provides a way
for you to get the names of the columns that come back from the query. Again,
check the Javadoc for details on its use.
We also haven't said anything about transactions, a key element in many
database applications. We'll say more about that as we get into the enterprise-
scale applications.
What we have covered should enable you to connect to a database, make
real queries, and process the results. There are more advanced techniques to
learn for special cases, but what we've covered here, accompanied by the
Javadoc pages for java.sql.* classes, should be enough to create useful, real
applications.
And of course there is always that other good teacher, experience. So go
try some of what you now know.
15.9
R ESOURCES
If you are going to use an Oracle database, we highly recommend Java Oracle
Database Development by David Gallardo (ISBN 0130462187, Prentice Hall
PTR), part of their Oracle Series. It includes several introductory chapters on
database design, SQL, and even PL/SQL. It then has a much more thorough
coverage of JDBC topics, with examples specific to Oracle, than we can cover
in our limited space.
A
JDBC
implementation
for
MySQL
is
available
at
http://www.mysql.com/downloads/api-jdbc.html .
JDBC tutorial information, as well as lots of other JDBC information, is
available from Sun at http://www.java.sun.com/products/jdbc/ .
Search WWH ::




Custom Search