Java Beans Question and Answers

9. What are the steps to be followed in creating a new Bean?
  The steps that must be followed while creating a new Bean are :
  • Create a directory for the new Bean.
  • Create the Java source file(s).
  • Compile the source file(s).
  • Create a manifest file.
  • Generate a JAR file.
  • Start the BDK.
  • Test.
Your Name Your Email-ID
Your Answer
10. What are the different JDBC driver types?
  There are four types of JDBC drivers each having its own functionality. They are classified based on how they access data from the database. They do not substitute one another.
  • JDBC-ODBC bridge driver- : It provides JDBC access via most ODBC drivers.
  • Native –API party : Java driver – It coverts JDBC calls into calls on the Client API for Oracle, Sybase, etc.
  • Native- protocol all –Java driver : It converts JDBC calls into the network protocol used by DBMS directly. This allows a direct call from the client machine to the DBMS server and is a practical solution for intranet access.
  • Net-protocol all- Java driver : It translates JDBC calls into a DBMS independent net protocol which is then translated to DBMS protocol by a server. This net server middle-ware is able to connect all Java clients to many different databases.
Your Name Your Email-ID
Your Answer
11. How is a manifest file created?
  Follow the steps to create a manifest file:
  • Open a new file with filename. Man extension.
  • Store the .class file in the above file as follows:
    Name: filename.class
    JavaBean: True
Your Name Your Email-ID
Your Answer
12. What is DatabaseMetaData?
  • DatabaseMetaData is a class provided by java.sql package to get all the information about the database, viz. tables in the data dictionary, names of the stored procedures, primary keys of table, etc.
  • The DatabaseMetaData object is created by calling the getMetaData() method of the Connection interface.
  • The syntax is so as follows:
  • DataBaseMetaData dbm = con . getMetaData();
Your Name Your Email-ID
Your Answer
1234 Page 3 of 4