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

JDBC, Java Server Pages, and MySQL Questions and Answers

31.

Java bytecode is machine-specific code.

Answer: B

Correct answer: False

Bytecode is machine-independent: it is the instruction set of the virtual machine rather than of any processor, which is what allows one compiled file to run wherever a JVM exists. Machine-specific code is what the JVM produces internally, or what a conventional compiler emits.

Please log in or register to report this question.

32.

MySQL maintains metadata in the database meta_sql.

Answer: B

Correct answer: False

The database is called mysql, not meta_sql. It holds the server’s own catalogue - users, privileges and configuration - and can be queried like any other database, though privileges are normally changed through GRANT rather than by writing to its tables.

Please log in or register to report this question.

33.

________ is an open source DBMS product that runs on UNIX, Linux and Windows.

Answer: A

Correct answer: MySQL

MySQL is the open source relational DBMS that runs on Unix, Linux and Windows alike, and it is the database half of the LAMP stack. Its portability comes from the same source as Java’s: the server is built for each platform while the SQL and the client protocol stay the same.

Please log in or register to report this question.

34.

How many JDBC driver types does Sun define?

Answer: D

Correct answer: Four

Sun defines four types. Type 1 is the JDBC-ODBC bridge; Type 2 calls the DBMS’s own native API through a client library; Type 3 talks to a middleware server in a network protocol; and Type 4 is pure Java speaking the DBMS protocol directly. The numbering runs from most dependent on native code to least.

Please log in or register to report this question.

35.

The JVM (Java virtual machine) interprets Java bytecode at run time.

Answer: B

Correct answer: True

This is what the virtual machine is for. The compiler produces bytecode, which no processor can execute, and the JVM reads and executes it at run time. Modern implementations compile hot paths to native code as they run, but the essential arrangement is unchanged: the bytecode is portable and the JVM is what makes it executable.

Please log in or register to report this question.

36.

What is sent to the user via HTTP, invoked using the HTTP protocol on the user's computer, and run on the user's computer as an application?

Answer: B

Correct answer: A Java applet

An applet is bytecode downloaded to the browser over HTTP and executed on the user’s machine within the JVM the browser provides. A servlet is the counterpart running on the server, and an ordinary Java application is launched locally and involves no HTTP at all.

Please log in or register to report this question.

37.

Even though Java is machine-independent, JSPs are not.

Answer: B

Correct answer: False

JSPs are as portable as anything else in Java. They are translated into servlets, compiled to bytecode and run on the JVM, so a page written for one container on one platform will run on another. The machine independence of Java extends to everything built on it.

Please log in or register to report this question.

38.

What programming language(s) or scripting language(s) does Java Server Pages (JSP) support?

Answer: C

Correct answer: Java only

A JSP page mixes HTML with Java, and Java is the only language its scriptlets and expressions may be written in. This is one of the real differences from ASP, which supports VBScript and JScript - the two look alike on the page but rest on quite different technology underneath.

Please log in or register to report this question.

39.

Which JDBC driver Type(s) can be used in either applet or servlet code?

Answer: C

Correct answer: Both Type 3 and Type 4

Applets and servlets both need a driver that can work over a network without native code installed on the machine. Type 3 speaks to a middleware server and Type 4 speaks the DBMS protocol directly, and both are pure Java. 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.

40.

With JSP, the coding is done in Java and only in Java.

Answer: A

Correct answer: True

JSP supports Java and no other language, so every scriptlet, expression and declaration on the page is Java. This is a genuine difference from ASP, which accepts VBScript and JScript, and it is why the resemblance between the two technologies is confined to their appearance on the page.

Please log in or register to report this question.

Loading…
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