J2EE Web Development and JDBC Fundamentals
Covers Java web technologies including JSP, Servlets, and JDBC database connectivity
Questions
Which of the following is Data Definition Language?
- INSERT
- CREATE
- UPDATE
- DELETE
Which type of Statement can execute parameterized queries?
- PreparedStatement
- ParameterizedStatement
- ParameterizedStatement and CallableStatement
- All kinds of Statements (i.e. which implement a sub interface of Statement)
Which packages contain the JDBC classes?
- java.jdbc and javax.jdbc
- java.jdbc and java.jdbc.sql
- java.sql and javax.sql
- java.rdb and javax.rdb
Which of the following are true ?
- The executeUpdate method returns all the rows that were affected
- The executeUpdate method returns the no. of rows that were affected
- Depends , as there is more than one version of this method with different return types
- None
Which of the following is false wrt Transactions ?
- A transaction is a set of sql statements
- Auto commit to be set off before Transaction
- Auto commit to be set off after transaction
- Commit permanently records to database all changes waiting with current Connection
- Rollback is used in case of any error to undo transaction
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
- 5
- 6
- Compile error
- Runtime error
try {int x = Integer.parseInt(“one”);} Which of the following could be used to create appropriate catch block ?
- ClassCastException
- IllegalStateException
- NumberFormatException
- None
Which of the following method names follow the JavaBeans standard ?
- addSize
- getCust
- deleteRep
- putDimensions
What are the life-cycle methods of JSP?
- jspInit(), _jspService() & jspDestroy()
- init(), service(), destroy()
- doPost()
- none of the above
What do you understand by JSP translation?
- Parsing JSP using an XML Parser.
- Converting JSP into static Html content.
- Generating Servlet Code for the Jsp
- None
What are the J2EE clients from the below list?
- Applets
- Web Browsers
- Wireless clients.
- All the above
Can we have pure java code inside JSP
- True
- False
Every Custom Servlet extends javax.servlet.http.HttpServlet class
- True
- False
Web container translates JSP to Servlet for every request of the JSP
- True
- False
A JSP page can include another JSP page but not an HTML page
- True
- False
What are the different scopes available?
- page, request & session
- page, request & application.
- page, request, session & application
- request, session & application.
Which are implicit objects in a JSP?
- only request, response
- only request, response & application
- request, response, session & application
- None
Difference between GET & POST method. (Choose the right answer)
- Query length is limited in POST, not limited in GET.
- POST is secured whereas data is been submitted as part of URL in GET (not secured).
- By using POST method, we cannot submit the form.
- None
A servlet instance (object) is created during the execution of JSP.
- True
- False
A servlet can handle multiple requests concurrently.
- True
- False