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

    Myh Case

    • 278 Words
    • 2 Pages

    This is the representation of costs for each month. You can see that Project Management costs are equally divided throughout 6-month period. Requirements Definition should be completed in October. Web site design starts in November and lasts till the mid-January, when it should be completed and should allow a start of Web Site Development phase. Web Site Development should continue from last week of January to the beginning of March. After development completion, we will start Testing for two weeks, and after all the tests are finished, we will start Training, Rollout and Support processes which should end on April 1, 2008.…

    • 278 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

    Things I Learned In Dare

    • 745 Words
    • 3 Pages

    I learned in D.A.R.E that smoking and doing drugs can affect how you breath and it will turn your lungs a black moldy color. D.A.R.E helps you make good decisions on what to do if somebody asks if you want a cigarette or if they want you to drink with them. One of the things that I learned in D.A.R.E is peer pressure and peer pressure can be bad or good. One of the things that you feel when you have peer pressure is stress and what do I do. One example for peer pressure is if somebody cool asks if you want to smoke so that would be a negative feeling of peer pressure because you want to be cool but you know you get in trouble when your parents found out. A good example for peer pressure is somebody gets you to go and make a friend that you noticed they barely have friends so thats good peer pressure.…

    • 745 Words
    • 3 Pages
    Good 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
  • 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
  • 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
  • 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