Machine-translated by Google. Questions are authored in English.
Top

JDBC, Java Server Pages, and MySQL Questions and Answers

Answer: C

Correct answer: In the MySQL database mysql

MySQL keeps its own catalogue in a database called mysql, which holds the user accounts, privileges and other server metadata. It is an ordinary database and can be queried like any other, which is how privileges are inspected, though they are normally changed through GRANT rather than by writing to the tables directly.

Please log in or register to report this question.

12.

To run a compiled Java program, the machine must have what loaded and running?

Answer: A

Correct answer: Java virtual machine

Compilation produces bytecode rather than machine code, and bytecode is not executable by any processor directly. The Java virtual machine reads it and executes it, and it is the JVM that differs from platform to platform while the bytecode does not - which is the whole of the write once, run anywhere claim.

Please log in or register to report this question.

13.

Apache Web server does not support servlets.

Answer: A

Correct answer: True

The Apache web server serves HTTP and static content and does not execute servlets; that is Tomcat’s function. The two are commonly deployed together, Apache handling ordinary requests and passing those for servlets and JSPs through to Tomcat, so the combination supports servlets although Apache alone does not.

Please log in or register to report this question.

14.

Sun defines four JDBC driver types.

Answer: B

Correct answer: True

Sun defines four: Type 1, the JDBC-ODBC bridge; Type 2, calling the DBMS’s native client library; Type 3, speaking to middleware over a network; and Type 4, pure Java speaking the DBMS protocol directly. The four differ in how much native code they require and hence in where they can be deployed.

Please log in or register to report this question.

Answer: B

Correct answer: Java servlet.

A JSP page is translated by the container into the source of a servlet, which is then compiled and run like any other. The translation happens once, on first request, which is why the first hit on a page is slow and later ones are not. The JSP is therefore a convenient way of writing a servlet, not a different technology.

Please log in or register to report this question.

16.

Type 3 and Type 4 JDBC drivers can be used for sevlets and applets.

Answer: A

Correct answer: True

Types 3 and 4 are pure Java and need nothing installed on the machine they run on, so they are usable from an applet in a browser as well as from a servlet on a server. Types 1 and 2 depend on ODBC or a native client library being present locally, which an applet cannot assume.

Please log in or register to report this question.

Answer: C

Correct answer: By one of Tomcat's threads

Tomcat runs the translated servlet inside its own process, allocating one of its threads to each request. Nothing is forked and no separate process is started, which is exactly why servlets are so much faster than CGI scripts - and why they must be written to be thread-safe.

Please log in or register to report this question.

18.

JDBC stands for Java Database Connectivity

Answer: A

Correct answer: True

Java Database Connectivity is the standard API for issuing SQL from Java. The application programs against JDBC and the driver, loaded at run time, translates for the particular DBMS - which is how the same code runs against different databases without alteration.

Please log in or register to report this question.

19.

MySQL is just as powerful as Oracle and is half the price.

Answer: B

Correct answer: False

The two are not equivalent products. Oracle offers a range of enterprise features that MySQL of this period did not, and the pricing comparison is not half the price but free against a substantial licence fee. Which is the better choice depends on the application; the claim as stated is wrong on both halves.

Please log in or register to report this question.

20.

Which JDBC driver Type(s) can you use in a three-tier architecture and if the Web server and the DBMS are running on the same machine?

Answer: D

Correct answer: All of Type 1, Type 2, Type 3 and Type 4

With the web server and the DBMS on one machine, the driver runs where the native libraries are and no network is crossed, so nothing rules any type out. Types 1 and 2 become impracticable only when the code must run somewhere the native components are not installed, which is the applet and distributed cases.

Please log in or register to report this question.

Loading…

Other Subjects

Tags: JDBC, Java Server Pages, and MySQL Questions and Answers || JDBC, Java Server Pages, and MySQL MCQ Questions and Answers || JDBC, Java Server Pages, and MySQL GK Questions and Answers || JDBC, Java Server Pages, and MySQL GK MCQ Questions || JDBC, Java Server Pages, and MySQL Multiple Choice Questions and Answers || JDBC, Java Server Pages, and MySQL GK || GK on JDBC, Java Server Pages, and MySQL || Database Questions and Answers || Database MCQ Questions and Answers || Database GK Questions and Answers || GK on Database