Wednesday, October 24, 2007

Java RMI, JDBC, XML Interview questions


RMI, JDBC, XML

Question: What is the query used to display all tables names in SQL Server (Query analyzer)? (JDBC)

Answer: select * from information_schema.tables

Question: How many types of JDBC Drivers are present and what are they?

Answer: There are 4 types of JDBC Drivers

Type 1: JDBC-ODBC Bridge Driver

Type 2: Native API Partly Java Driver

Type 3: Network protocol Driver

Type 4: JDBC Net pure Java Driver

Question: What is the fastest type of JDBC driver?

Answer: JDBC driver performance will depend on a number of issues:

(a) the quality of the driver code,

(b) the size of the driver code,

(c) the database server and its load,

(d) network topology,

(e) the number of times your request is translated to a different API.

In general, all things being equal, you can assume that the more your request and response change hands, the slower it will be. This means that Type 1 and Type 3 drivers will be slower than Type 2 drivers (the database calls are make at least three translations versus two), and Type 4 drivers are the fastest (only one translation).

Question: Is the JDBC-ODBC Bridge multi-threaded?

Answer: No. The JDBC-ODBC Bridge does not support concurrent access from different threads. The JDBC-ODBC Bridge uses synchronized methods to serialize all of the calls that it makes to ODBC. Multi-threaded Java programs may use the Bridge, but they won't get the advantages of multi-threading.

Question: Does the JDBC-ODBC Bridge support multiple concurrent open statements per connection?

Answer: No. You can open only one Statement object per connection when you are using the JDBC-ODBC Bridge.

Question: What is cold backup, hot backup, warm backup recovery?

Answer: a. cold backup - All these files must be backed up at the same time, before the databaseis restarted.

b. hot backup - official name is 'online backup' ? is a backup taken of each tablespace while the database is running and is being accessed by the users.

Question: When we will Denormalize data?

Answer: Data denormalization is reverse procedure, carried out purely for reasons of improving performance.It maybe efficient for a high-throughput system to replicate data for certain data.

Question: What is the advantage of using PreparedStatement?

Answer: If we are using PreparedStatement the execution time will be less.The PreparedStatement object contains not just an SQL statement,but the SQL statement that has been precompiled.This means that when the PreparedStatement is executed,the RDBMS can just run the PreparedStatement's Sql statement without having to compile it first.

0 comments:

Advertisement

 

Copyright 2008 All Rights Reserved Revolution Two Church theme by Brian Gardner Converted into Blogger Template by Bloganol dot com