JDBC Project - Emerald City Team
JDBC Exam Questions
- How can I use JDBC to access a desktop database
like Microsoft Access over a network? ANSWER:
Most desktop databases uses ODBC. The best approach
is to use a commercial JDBC driver such as the drivers from Symantec and IDS
software. The JDBC-ODBC bridge from JavaSoft does not provide network access
to desktop databases by itself. The JDBC-ODBC bridge loads ODBC as a local
DLL, and typical ODBC drivers for desktop databases like Access aren't
networked. The JDBC-ODBC bridge can be used together with the RMI-JDBC
bridge to access Access over the net. The solution from Dyade is free. Read more in the JDBC FAQ
- Describe the four types of JDBC Drivers.
ANSWER:
- The JDBC-ODBC bridge uses ODBC drivers to
access the database. When using the bridge, some ODBC binary code must
exist on the client.
- A native-API partly-Java driver converts JDBC calls
into native API calls to access database. This type of driver also
requires that some binary code exists on the client.
- A net-protocol all-Java driver translates JDBC calls
into a vendor specific protocol which is then translated to a DBMS
protocol by a server. According to Sun's website, this is the most
flexible JDBC alternative. The examples in this website use this type of
driver.
- A native-protocol all-Java driver converts JDBC calls
directly into the network protcol used by the DBMS.
More specific
information can be found on Sun's JDBC Site.
-
What is ODBC? ANSWER: Open DataBase Connectivity (ODBC) is an Application
Programming Interface (API) that allows a programmer to abstract a program
from a database. When writing code to interact with a database, you usually
have to add code that talks to a particular database using a proprietary
language. If you want your program to talk to an Access, Fox and Oracle
databases you have to code your program with three different database
languages. This can be quite the daunting task causing much grief. Now,
enter ODBC... When programming to interact with ODBC you only need to talk
the ODBC language (a combination of ODBC API function calls and the SQL
language). The ODBC Manager will figure out how to contend with the type of
database you are targeting. Regardless of the database type you are using,
all of your calls will be to the ODBC API. All that you need to do is have
installed an ODBC driver that is specific to the type of database you will
be using.
-
Are JDBC Java applications truly portable? ANSWER: No, it depends on what database you
are connecting to and on which platform. For the most part, if you are
working on the Microsoft Windows platform, you can use the JDBC-ODBC bridge
designed by Sun Microsystems to connect to any database in Windows that is
ODBC compatible. However, if you are using a UNIX or Linux platform, you
will need the JDBC drivers from the vendor of the database you are using.
Therefore, depending on the platform and database you are developing your
Java application for, the code may not be truly portable.
-
What advantage is there to writing JDBC applications? ANSWER:
By writing applications to the JDBC specifications, application developers
can spend less time porting their code to specific operating systems and
DBMS's, and more time improving their client applications and responding to
users' needs. Furthermore, information technology units can distribute one
client application to its users instead of several, each for a certain data
source. Finally, Java applets can be developed on the World Wide Web to
allow customer interaction with corporate databases via that customer's
favorite Web browser.