Skip to main content

Posts

Showing posts from May, 2009

JTS, SWT, JFace Interview Questions

What is JTS? Among the enterprise distributed computing specifications, Java Transaction Service is one. The interoperability is ensured along with sophisticated transaction resources such as transaction managers on the Java platform is ensured by Java Transation Service. The implementation of the transaction managers is specified by JTS which supports Java Transaction API. The JTS is the implementation of the OMG OTS specification. What is a distributed transaction? The involvement two or more network hosts for operations bundle, is called distributed transaction. The transactional resources are provided by the hosts and creating and managing the global transactions encompassing all operations against such resources is the responsibility of transaction manager. Similar to other transactions, distributed transactions must have all the ACID properties. The transactions among multiple participating databases are distributed among different physical locations. Explain the types of isolati...

Java Native Interface (JNI) Interview Questions

What is Native Interface in JAVA? Answer JNI is the mechanism used to invoke methods written in languages such as c and C++. You can write code using language like c and c++ and declare its native methods and can use the same method in java using JNI. JNI exposes JNI functions and pointers that can access java objects and methods. What is Native Interface in JAVA? Java Native Interface permits the developers to integrate the native code such as C or C++ into a java application. To take the advantages of C programming and implementing the Java GUI features together makes the applications more efficient and powerful. JNI is used to handle situations where the entire application can not be written in java. Explain the advantages and disadvantages of using JNI. Answer Advantages of JNI Using JNI, we can access c and c++ code which adds performance boost to JAVA. JNI allows JAVA to access some hardware features using other languages like c and c++. Disadvantages of JNI JNI uses native lan...

Java Socket Interview Questions

Explain how to create and use sockets in java. Client Side: //creating client socket socket=new Socket("localhost",4000); //InetAddress.getByName ("127.0.0.1") //cretaing output stream for writting a data write=new DataOutputStream(socket.getOutputStream()); //reading from a console read=new DataInputStream(System.in); String data=null; while(true) { data=read.readLine(); write.writeUTF(data); } Server : //creating severSocket object. server=new ServerSocket(4000, 2); System.out.println("Socket open"); //accept() method listens for a connection to be made to this socket and accepts it. client=server.accept(); System.out.println("Client connected"); //receive inputs from client receive=new DataInputStream(client.getInputStream()); String data=null; while(true) { data=receive.readUTF(); System.out.println(data); } How to send to receive datagram packet? DatagramSocket s = new DatagramSocket(null); s.bind(new InetSocketA...

Java URL Connection Interview Questions

Explain the difference between a URL instance and a URL connection instance. URL instance represents the location of a resource, and a URLConnection instance represents a link for accessing or communicating with the resource at the location Explain how to make a connection to a URL. Connection to the remote object represented by the URL is only initiated when the connect() method of the URLConnection is called. Doing this initializes a communication link between your Java program and the URL over the network. The following code show how a connection to a URL is made. try { URL xyz = new URL( http://www.xyz.com/ ); URLConnection xyzConnection = xyz.openConnection(); xyzConnection.connect(); } catch (MalformedURLException e) { // new URL() failed . . . } catch (IOException e) { // openConnection() failed . . . } Explain how to read from a remote file when we have its URL. With the help of the following code you could dir...

Linux Admin Interview Questions

Give an example of set of shell commands that will give you the number of files in a directory How do you tell what process has a TCP port open in Linux On a Red Hat Linux Variant how do you control whether a service starts when the system boots How do you tell the amount of free disk space left on a volume Give an example of a set of shell commands to tell how many times â€Å“bob” has logged on to the system this month Give an example of a recursively copying a directory from one location to another. How do you modify the IP and Net mask of a system running a Red Hat Variant of Linux Give an example of a set of shell commands that will give you the number of â€Å“httpd” processes running on a Linux box. On CentOS or Fedora based system using the package management application, how do you tell what package provided the file â€Å“libnss_ldap.so” What is the difference between VTP client, server, and transparent What is the maximum length of CAT6 How does one set up a layer two link to s...

Linux Interview Questions

You need to see the last fifteen lines of the files dog, cat and horse. What command should you use? tail -15 dog cat horse The tail utility displays the end of a file. The -15 tells tail to display the last fifteen lines of each specified file. Who owns the data dictionary? The SYS user owns the data dictionary. The SYS and SYSTEM users are created when the database is created. You routinely compress old log files. You now need to examine a log from two months ago. In order to view its contents without first having to decompress it, use the _________ utility. zcat The zcat utility allows you to examine the contents of a compressed file much the same way that cat displays a file. You suspect that you have two commands with the same name as the command is not producing the expected results. What command can you use to determine the location of the command being run? which The which command searches your path until it finds a command that matches the command you are looking for and displ...

SQL Interview Questions

What are two methods of retrieving SQL? What cursor type do you use to retrieve multiple recordsets? What is the difference between a "where" clause and a "having" clause? - "Where" is a kind of restiriction statement. You use where clause to restrict all the data from DB.Where clause is using before result retrieving. But Having clause is using after retrieving the data.Having clause is a kind of filtering command. What is the basic form of a SQL statement to read data out of a table? The basic form to read data out of table is 'SELECT * FROM table_name; ' An answer: 'SELECT * FROM table_name WHERE xyz= 'whatever';' cannot be called basic form because of WHERE clause. What structure can you implement for the database to speed up table reads? - Follow the rules of DB tuning we have to: 1] properly use indexes ( different types of indexes) 2] properly locate different DB objects across different tablespaces, files and so on.3] cre...

WinRunner Interview Questions

Explain WinRunner testing process? - a) WinRunner testing process involves six main stages i.Create GUI Map File so that WinRunner can recognize the GUI objects in the application being tested ii.Create test scripts by recording, programming, or a combination of both. While recording tests, insert checkpoints where you want to check the response of the application being tested. iii.Debug Test: run tests in Debug mode to make sure they run smoothly iv.Run Tests: run tests in Verify mode to test your application. v.View Results: determines the success or failure of the tests. vi.Report Defects: If a test run fails due to a defect in the application being tested, you can report information about the defect directly from the Test Results window. What is contained in the GUI map? - a) WinRunner stores information it learns about a window or object in a GUI Map. When WinRunner runs a test, it uses the GUI map to locate objects. It reads an object̢۪s description in the GUI map and then...