CS506 - Web Design and Development Midterm Subjective Paper May-2012
20 MCQs
6 Questions of Theory
1. For a company named ABC what are the basic steps to communicate their database with JDBC through Java languages.(5 marks)
2. Write the names of steps to make a simple client in Java client Server application. (5marks)
3. Write down the code for a method of ResultMetaData object (rs) to return the database type name of second column. (3 marks)
Answer:
2. Write the names of steps to make a simple client in Java client Server application. (5marks)
3. Write down the code for a method of ResultMetaData object (rs) to return the database type name of second column. (3 marks)
Answer:
ResultSet rs = stmt.executeQuery("SELECT * FROM TABLE2");
ResultSetMetaData rsmd = rs.getMetaData();
String secondColName ; // creat a varible to hold name of filed
secondColName = rsmd.getColumnName(2); // getColumnName(2) method will extract 2nd column name
System.out.println(secondColName); // display name of 2nd column.
int columnType; //to hold the value of
columnType = rsmd.GetColumnType(2);// This method returns the underlying database type, rather than a FieldType(Bonfire)
ResultSetMetaData rsmd = rs.getMetaData();
String secondColName ; // creat a varible to hold name of filed
secondColName = rsmd.getColumnName(2); // getColumnName(2) method will extract 2nd column name
System.out.println(secondColName); // display name of 2nd column.
int columnType; //to hold the value of
columnType = rsmd.GetColumnType(2);// This method returns the underlying database type, rather than a FieldType(Bonfire)
4. Describe types of statements used in JDBC. (3 marks)
5. You need to state the names of any four applet life cycle methods. (2 marks)
6. Suppose we created a button in a program which can generate events and then we built an object that can handle these events. You need to state that are we completed all the necessary steps in our program for handling the events of that button. (2 marks)
5. You need to state the names of any four applet life cycle methods. (2 marks)
6. Suppose we created a button in a program which can generate events and then we built an object that can handle these events. You need to state that are we completed all the necessary steps in our program for handling the events of that button. (2 marks)