Академический Документы
Профессиональный Документы
Культура Документы
1. Which of the following static SQL statements can use a host variable?
A. FETCH
B. ROLLBACK
C. DROP INDEX
D. ALTER TABLE
2. Which of the following JDBC interfaces contains methods that are called to determine
whether or not cursors persist across COMMIT boundaries?
A. ResultSet
B. Statement
C. DatabaseMetaData
D. ResultSetMetaData
3. Which of the following JDBC objects can be used to determine the SQLSTATE if execution of
a query fails?
A. Statement
B. ResultSet
C. SQLException
D. ResultSetMetaData
4. Which of the following can be used to access a DB2 database from a workstation that does
not have any DB2 code installed?
A. Trigger
B. Java Applet
C. SQL Routines
D. External Stored Procedure
5. Which of the following programming interfaces can be used to program static queries from
a Java application?
A. CLI
B. JTA
C. JDBC
D. SQLJ
E. OLEDB
6. Given a cursor C1 on table T1. For every row fetched from T1, open a cursor C2 on table
T2. For every row fetched from T2, update column C1 in table T2 and issue a COMMIT.
7. Given an ODBC/CLI program with a single connection, two threads and the following
actions:
Assuming that AUTOCOMMIT is ON, how many records will be successfully inserted into the
table MYTAB?
A. 1
B. 2
C. 3
D. 4
Which of the following statements is used to retrieve rows from the table and allows the
second column to be checked for NULL values?
Which of the following statements will remove Procedure 1 from the database?
10. During which of the following are SQL statements optimized when using DB2 CLI?
A. cursor open
B. precompile phase
C. application binding
D. statement preparation
How many rows will be inserted into the NOTIFYLOG table as a result of the trigger activations
caused by the successful execution of the following set of SQL statements?
A. 2
B. 3
C. 4
D. 5
(program logic)
(:usera contains the string "usera")
( wa contains a valid password)
(:userb now contains the string "userb")
( wb contains a valid password)
End Program
What table will be updated in "samplea" if the second DELETE completes successfully?
A. usera.tablex
B. userb.tablea
C. usera.tablea
D. userb.tablex
13. Which of the following ODBC/CLI statement handle attributes permits an application to
change the memory address of all bound parameter markers without making any ODBC/CLI
API calls?
A. SQL_ATTR_PARAM_BIND_TYPE
B. SQL_ATTR_PARAM_STATUS_PTR
C. SQL_ATTR_PARAM_OPERATION_PTR
D. SQL_ATTR_PARAM_BIND_OFFSET_PTR
A user called XYZ is to be enabled to access data from table ABC.STUFF using an implicit
schema.
Assuming the necessary privileges have been granted, which of the following statements
issued by user ABC will provide this result?
15. Which of the following is required to successfully execute a DB2 Call Level Interface (CLI)
application?
16. USERA has authority to access all tables in a database. Which DB2 application
development interface should be used to restrict USERA from accessing tables with payroll
information during application runtime?
A. CLI
B. JDBC
C. Embedded static SQL
D. Embedded dynamic SQL
Which two of the following examples correctly demonstrate the use of host variables within an
SQL statement?
(Choose 2)
18. Given that any referenced database objects exist and all host variables have been declared
appropriately.
Which two of the following lines of embedded SQL code can be successfully precompiled into
the appropriate host-language source?
(Choose 2)
A. userid
B. server name
C. prep options
D. profile name
20. Assume that the following SQL statements have been successfully issued:
CONNECT TO db1 USER user1 USING pw1
DECLARE GLOBAL TEMPORARY TABLE temp1 (val INTEGER) ...
Which of the following statements will successfully insert a row into the temporary table
TEMP1?
Which of the following statements will retrieve the lowest computed value?
A. ctx.rowsUpdated()
B. ctx.SQLRowCount()
C. ctx.getUpdateCount()
D. con.getUpdateCount()
23. An SQLJ application needs to connect to a remote data source SAMPLE using a userid and
password. Which of the following will establish the connection?
24. Which of the following CLI/ODBC functions will return the number of rows affected by an
INSERT, UPDATE or a DELETE statement?
A. SQLNumRows()
B. SQLRowCount()
C. SQLRowsChanged()
D. SQLUpdateCount()
A. Derived view
B. Derived table
C. Scalar subselect
D. Common table expression
26. Which of the following must be used by an application to retrieve multiple rows?
A. SQLCA
B. CURSOR
C. SELECT INTO statement
D. COMPOUND SQL statement