J2EE Web Development and JDBC Fundamentals

Covers Java web technologies including JSP, Servlets, and JDBC database connectivity

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which of the following is Data Definition Language?

  1. INSERT
  2. CREATE
  3. UPDATE
  4. DELETE
Question 2 Multiple Choice (Single Answer)

Which type of Statement can execute parameterized queries?

  1. PreparedStatement
  2. ParameterizedStatement
  3. ParameterizedStatement and CallableStatement
  4. All kinds of Statements (i.e. which implement a sub interface of Statement)
Question 3 Multiple Choice (Single Answer)

Which packages contain the JDBC classes?

  1. java.jdbc and javax.jdbc
  2. java.jdbc and java.jdbc.sql
  3. java.sql and javax.sql
  4. java.rdb and javax.rdb
Question 4 Multiple Choice (Single Answer)

Which of the following are true ?

  1. The executeUpdate method returns all the rows that were affected
  2. The executeUpdate method returns the no. of rows that were affected
  3. Depends , as there is more than one version of this method with different return types
  4. None
Question 5 Multiple Choice (Single Answer)

Which of the following is false wrt Transactions ?

  1. A transaction is a set of sql statements
  2. Auto commit to be set off before Transaction
  3. Auto commit to be set off after transaction
  4. Commit permanently records to database all changes waiting with current Connection
  5. Rollback is used in case of any error to undo transaction
Question 6 Multiple Choice (Single Answer)

public class NumbPlay { int x=5; public static void main(String[] args) { new NumbPlay().doPlay(); } void doPlay() { int x; System.out.println(++x); } } The output is

  1. 5
  2. 6
  3. Compile error
  4. Runtime error
Question 7 Multiple Choice (Single Answer)

try {int x = Integer.parseInt(“one”);} Which of the following could be used to create appropriate catch block ?

  1. ClassCastException
  2. IllegalStateException
  3. NumberFormatException
  4. None
Question 8 Multiple Choice (Single Answer)

Which of the following method names follow the JavaBeans standard ?

  1. addSize
  2. getCust
  3. deleteRep
  4. putDimensions
Question 9 Multiple Choice (Single Answer)

What are the life-cycle methods of JSP?

  1. jspInit(), _jspService() & jspDestroy()
  2. init(), service(), destroy()
  3. doPost()
  4. none of the above
Question 10 Multiple Choice (Single Answer)

What do you understand by JSP translation?

  1. Parsing JSP using an XML Parser.
  2. Converting JSP into static Html content.
  3. Generating Servlet Code for the Jsp
  4. None
Question 11 Multiple Choice (Single Answer)

What are the J2EE clients from the below list?

  1. Applets
  2. Web Browsers
  3. Wireless clients.
  4. All the above
Question 12 True/False

Can we have pure java code inside JSP

  1. True
  2. False
Question 13 True/False

Every Custom Servlet extends javax.servlet.http.HttpServlet class

  1. True
  2. False
Question 14 True/False

Web container translates JSP to Servlet for every request of the JSP

  1. True
  2. False
Question 15 True/False

A JSP page can include another JSP page but not an HTML page

  1. True
  2. False
Question 16 Multiple Choice (Single Answer)

What are the different scopes available?

  1. page, request & session
  2. page, request & application.
  3. page, request, session & application
  4. request, session & application.
Question 17 Multiple Choice (Single Answer)

Which are implicit objects in a JSP?

  1. only request, response
  2. only request, response & application
  3. request, response, session & application
  4. None
Question 18 Multiple Choice (Single Answer)

Difference between GET & POST method. (Choose the right answer)

  1. Query length is limited in POST, not limited in GET.
  2. POST is secured whereas data is been submitted as part of URL in GET (not secured).
  3. By using POST method, we cannot submit the form.
  4. None
Question 19 True/False

A servlet instance (object) is created during the execution of JSP.

  1. True
  2. False
Question 20 True/False

A servlet can handle multiple requests concurrently.

  1. True
  2. False