MID Exam UML
MID Exam UML
MID Exam UML
2. Given:
import java.sql.*;
public class ConnectClass
{ public Connection con; public Statement st; public ResultSet rs;
public ConnectClass()
{
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:swingpro"); st =
con.createStatement();
}catch(SQLException ex)
{
System out println("Connection error"):
When this program prints “Connection error2†?
12. When a statechart is checked for consistency with other models of the
system which of the following is true?
22. Which of the following statements is true about actions and activities?
a. An activity may be tied to a transition.
b. An action may only be tied to transitions.
c.Both actions and activities may be tied to a state.
32. If you want to see a list of all authors and the books, which of the
following statements is correct?
a. The JDBC API provides the abstraction and the JDBC drivers provide the
implementation.
b. new drivers can be plugged-in to the JDBC API without changing the
client code.
c. Both of the above.
37. Which of the following is not a reason for separating the analysis
stage from the design stage?
a. Analysts and designers may be people with different skills and
knowledge.
b. It is not possible to begin design until all the analysis has been
completed.
c. clients will want clear decision points at which they can agree that the Go
to Settings to activate Time Elapsed progress to the next stage and incur
further costs.
38. Which of the following best describes when primary operations should
be shown on class diagrams?
a. A icon
b. A symbol
c.A textual language
d.A graphical language
a.ClassException
b.SQLException
c. SQLWARNING
43. A statechart may have states that include substates. Which of the
following is true?
a. Component diagrams
b.Deployment diagrams
c.All
54. Which of the following best describes how composition differs from
aggregation?
67. Which of the following is more efficient than the statement due to
pre-compilation of SQL?
a. Statement
b.PreparedStatement
b.CallableStatement
c. None of the above.
74. Which of the following is more efficient than the statement due to
pre-compilation of SQL?
a. Statement
b.PreparedStatement
c.CallableStatement
d.None of the above.
81. Which of the following methods is used to move the cursor to the next
position?
a.first()
b.last()
c.movecursor()
d.next()
103. Given:
import java.sql.*;
public class ConnectClass
{ public Connection con;
public Statement st;
public ResultSet rs;
public ConnectClass()
{
try{
104. The transition from one state to another is triggered by an event. One
type of event is a change event. Which of the following statements is true?
a.A change event occurs when a condition becomes true.
b.A change event occurs when a condition changes.
c.A change event occurs when an attribute value changes in an object.
preparedStatement.setString(0, "John");
preparedStatement.setString(1, "John");
preparedStatement.setString(0, 'John');
preparedStatement.setString(1, 'John');
125. Which of the following is not one of the categories defined for the
GOF patterns?
a. Creational
b. Static
c. Behavioral
127. Most JDBC methods handle errors by throwing exceptions of What
type?
ClassNotFoundException
SQLException
SQLWARNING
128. If you want to see a list of all authors and the books, which of the
following statements is correct?
Select a.lastname, a.firstname,b.title from authors a, books b, auth_books
ab where a.authid-ab.auth_books ab where a.authid=ab.authid
Select a.lastname, a.firstname,b.title from authors a, books b, auth_books
ab where a.authid-ab.auth_books ab where a.authid-ab.authid and
b.isbn=ab.isbn
None
135. Which of the classes store the logical set of columns and rows of
data returned by executing a statement?
a. Statement
b. Meta data
c. Connection
d. Resultset
153. Which of the following is not one of the categories defined for the
GOF patterns?
a. Creational
b. Static
c. Behavioural
155. Which combination of cohesion and coupling is desirable in a
design?
a. High cohesion and low coupling.
b. High cohesion and high coupling.
c. Low cohesion and high coupling.
158. Which of the following are purposes for using Component diagrams?
a. Component diagrams can also be use as a static implementation
view of a system
b. Component diagrams are used to represent the working and behavior
of various components of a system.
c. a & b
d. none
184. Deployment diagrams are used to show the configuration of run –
time processing and physical architecture of the system.
a) True
b)False