Preview

Java Web development interview questions

Powerful Essays
Open Document
Open Document
34626 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Java Web development interview questions
Java Web development interview questions

1. Can we use the constructor, instead of init(), to initialize servlet? - Yes , of course you can use the constructor instead of init(). There’s nothing to stop you. But you shouldn’t. The original reason for init() was that ancient versions of Java couldn’t dynamically invoke constructors with arguments, so there was no way to give the constructur a ServletConfig. That no longer applies, but servlet containers still will only call your no-arg constructor. So you won’t have access to a ServletConfig or ServletContext.
2. How can a servlet refresh automatically if some new data has entered the database? - You can use a client-side Refresh or Server Push.
3. The code in a finally clause will never fail to execute, right? - Using System.exit(1); in try block will not allow finally code to execute.
4. How many messaging models do JMS provide for and what are they? - JMS provide for two messaging models, publish-and-subscribe and point-to-point queuing.
5. What information is needed to create a TCP Socket? - The Local System?s IP Address and Port Number. And the Remote System’s IPAddress and Port Number.
6. What Class.forName will do while loading drivers? - It is used to create an instance of a driver and register it with the DriverManager. When you have loaded a driver, it is available for making a connection with a DBMS.
7. How to Retrieve Warnings? - SQLWarning objects are a subclass of SQLException that deal with database access warnings. Warnings do not stop the execution of an application, as exceptions do; they simply alert the user that something did not happen as planned. A warning can be reported on a Connection object, a Statement object (including PreparedStatement and CallableStatement objects), or a ResultSet object. Each of these classes has a getWarnings method, which you must invoke in order to see the first warning reported on the calling object
8. SQLWarning warning = stmt.getWarnings();
9.

You May Also Find These Documents Helpful

  • Powerful Essays

    IS3220 FINAL STUDY GUIDE

    • 1708 Words
    • 7 Pages

    To establish a connection, TCP uses a three-way handshake. Before a client attempts to connect with a server, the server must first bind to and listen at a port to open it up for connections: this is called a passive open. Once the passive open is established, a client may initiate an active open. To establish a connection, the three-way (or 3-step) handshake occurs:…

    • 1708 Words
    • 7 Pages
    Powerful Essays
  • Good Essays

    Nt1110 Unit 3 Assignment

    • 655 Words
    • 3 Pages

    Here, Raspberry Pi will act as a server which will open a socket on a specified port which will wait for the incoming connection from the client machine once the connection is established it will send and receive messages and the connection will termi-nate only when the client side application exits. As mentioned earlier it is similar to a simple chat server where the client ma-chine will send some instructions as messages and the Pi will send acknowledgment or error message as message only. One thing that should be kept in mind here is that in the case of an error the server side code should not terminate. Now from here code can be further divided into five parts i.e.:…

    • 655 Words
    • 3 Pages
    Good Essays
  • Powerful Essays

    State The state of the connection. Most implementations use some form of the following values for state:…

    • 670 Words
    • 3 Pages
    Powerful Essays
  • Good Essays

    68) Which of the following is NOT the way to end a Visual Basic application?…

    • 3668 Words
    • 15 Pages
    Good Essays
  • Good Essays

    Nt1330 Unit 5 Assignment 1

    • 1348 Words
    • 6 Pages

    4. The server accept the connection and to send the data from server to client and vice…

    • 1348 Words
    • 6 Pages
    Good Essays
  • Satisfactory Essays

    NT1210 Lab 3.1 Review

    • 505 Words
    • 3 Pages

    What is the history of the TCP/IP model? Why was it created? Use your textbook and Internet research to support your answer.…

    • 505 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    Nt1310 Unit 1

    • 4209 Words
    • 17 Pages

    4) The DBA_OBJECTS view needs to be queried to find out how many __________________ a user has created…

    • 4209 Words
    • 17 Pages
    Powerful Essays
  • Satisfactory Essays

    Router Simulation

    • 331 Words
    • 2 Pages

    9. What numeric port range is commonly used by clients in a client -> server communication session? 0 to 1023…

    • 331 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    It 240 Appendix F

    • 260 Words
    • 2 Pages

    Transmission Control Protocol / Internet Protocol (TCP/IP) TCP is the protocol used in networking that provides a connection-oriented, reliable way for applications to communicate large amount of data at one time over a network. IP is a connectionless protocol responsible for addressing network devices, and routing packets between…

    • 260 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    lab 5

    • 440 Words
    • 2 Pages

    The significance of the TCP three-way handshake is that three messages are transmitted by TCP to negotiate and start a TCP session between the computers. The purpose is so that two computers can negotiate the parameters of the network TCP socket connection before transmitting the data. Wireshark is the application that uses TCP as a transport protocol.…

    • 440 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    7. Although in some programs a While statement should be infinite, in most programs a While statement should eventually end. How can you make sure that a While statement will eventually end?…

    • 610 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Java Project

    • 271 Words
    • 3 Pages

    Intend to build a career with leading corporate of hi-tech environment with committed & dedicated people, which will help me to explore myself fully and realize my potential.…

    • 271 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    Java Project

    • 3718 Words
    • 15 Pages

    SOFTWARE PROJECT MANAGEMENT TOOL deals with the various levels of project development and will account for time used in phases viz analysis, design, coding, testing…

    • 3718 Words
    • 15 Pages
    Powerful Essays
  • Better Essays

    JAVA LESSON 6

    • 1293 Words
    • 6 Pages

    6: Design, Debugging, Interfaces 6.092: Introduction to Java Assignment 5: main() Programs start at a main() method, but many classes can have main() public class SimpleDraw { /* ... stuff ... */ public static void main(String args[]) { SimpleDraw content = new SimpleDraw(new DrawGraphics()); /* ... more stuff ... */ } } Assignment 5: main()…

    • 1293 Words
    • 6 Pages
    Better Essays
  • Good Essays

    Job Interview Questions

    • 436 Words
    • 2 Pages

    a story about how “successful” you were in your last one or two jobs. Remember,…

    • 436 Words
    • 2 Pages
    Good Essays

Related Topics