Java Reference
In-Depth Information
You can connect to several different relational databases in your Java programs by using
JDBC or ODBC and Structured Query Language (SQL), a standard language for reading,
writing, and managing a database.
Q&A
Q Can the JDBC-ODBC bridge driver be used in an applet?
A The default security in place for applets does not allow the JDBC-ODBC bridge to
be used because the ODBC side of the bridge driver employs native code rather
than Java. Native code can't be held to the security restrictions in place for Java, so
there's no way to ensure that this code is secure.
JDBC drivers that are implemented entirely in Java can be used in applets, and
they have the advantage of requiring no configuration on the client computer.
Q What's the difference between Java DB and more well-known databases such
as Access and MySQL? Which should I use?
A Java DB is intended for database applications that have simpler needs than Access
and comparable databases. The entire application takes up 2MB of space, making
it easy to bundle with Java applications that require database connectivity.
Sun employs Java DB in several parts of the Java Enterprise Edition, which
demonstrates that it's capable of delivering strong, reliable performance on impor-
tant tasks.
Quiz
Review today's material by taking this three-question quiz.
Questions
1. What does a Statement object represent in a database program?
a. A connection to a database
b. A database query written in Structured Query Language
c. A data source
2. Which Java class represents SQL statements that are compiled before they are exe-
cuted?
a. Statement
b. PreparedStatement
c. ResultSet
 
 
Search WWH ::




Custom Search