0.0/ 5.0 Points
Question 1 of 20 The ______ interface communicates with the database, either directly or thought another database specific driver. ?
A. Statement
B. Connection
C. DirectManager
D. Driver
Question 2 of 20 Which java.sql class provides the getConnection! method?
5.0/ 5.0 Points
A. ResultSet 71
B. Connection
C. DriverManager
D. Driver
5.0/ 5.0 Points
Question 3 of 20 Which java.sql class or interface is used to create the object that is necessary for calling stored procedures?
A. CallableStatement
B. Statement
C. ResultSet
D. PrepareStatement
5.0/ 5.0 Points
Question 4 of 20 "f one intends to wor# with a $esult%et, which of these &repared%tatement methods will not wor#?
A. e!ecute"pate#$
B. e!ecute%uer$
C. e!ecute#$
Question 5 of 20 What is, in terms of '()C, a (ata%ource
5.0/ 5.0 Points
A. A DataSource is a 'actor& o' connections to a p(&sical ata source
B. A DataSource is a registr& point 'or )*D+,services
C. A DataSource is t(e basic service 'or managing a set o' )DBC rivers
D. A DataSource is t(e )ava representation o' a p(&sical ata source
Question 6 of 20 The methods of what type of object can be used to move the cursor through a result set? ?
A. Statement
B. "R-
C. Connection
D. ResultSet
0.0/ 5.0 Points
Question 7 of 20 Which of the following describes a '()C type * driver?
0.0/ 5.0 Points
A. )DBC,DBC brige plus DBC river
B. *ative,AP+ partl& )ava river
C. *ative,protocol pure )ava river
D. )DBC,*et pure )ava river
Question 8 of 20 +re prepared statements actually compiled
5.0/ 5.0 Points
A. es es t(e& compile
B. *o t(e& are boun b& t(e )DBC river
Question 9 of 20 What is correct about (( statements create, grant,...!
5.0/ 5.0 Points
A. DD- statements are treate as normal S%- statements an are e!ecute b& calling t(e e!ecute#$ met(o on a Statement #or a sub inter'ace t(ereo'$ obect B. DD- statements cannot be e!ecute b& ma2 ing use o' )DBC &ou s(oul use t(e native atabase tools 'or t(is. C. Support 'or DD- statements 3ill be a 'eature o' a 'uture release o' )DBC
D. 4o e!ecute DD- statements &ou (ave to install aitional support 'iles
Question 10 of 20
5.0/ 5.0 Points
+ method that ta#es a %tudent object and writes it to the %tudent table in a database implements ___________. ?
A. ResultSetMetaData
B. connection pooling
C. R mapping #obect to relational$
D. init estro&
Question 11 of 20 What is the meaning of $esult%et.T-&_%C$/_"0%0% $esult%et.T-&_%C$/_"0%0%"T"1 "T"1
5.0/ 5.0 Points
A. 4(is means t(at t(e ResultSet is sensitive to scrolling but insensitive to c(anges mae b& ot(ers B. 4(is means t(at t(e Resultset is sensitive to scrolling but insensitive to upates i.e. not upateable C. 4(e meaning epens on t(e t&pe o' ata source an t(e t&pe an version o' t(e river &ou use 3it( t(is ata source D. 4(is means t(at t(e ResultSet is insensitive to scrolling
Question 12 of 20 Which of following is wrong about Callable%tatement
0.0/ 5.0 Points
A. 4(e obect o' CallableStatement class can be create using Connection.createCallableStatement#$ met(o. B. 4(e obect o' CallableStatement class can be create using Connection.prepareCall#$ met(o.
C. 4(is inter'ace is use to e!ecute S%- store proceures.
D. 4(is e!tens PrepareStatement inter'ace.
Question 13 of 20 +re $esult%ets updateable
5.0/ 5.0 Points
A. es but onl& i' &ou inicate a concurrenc& strateg& 3(en e!ecuting t(e statement an i' t(e river an atabase support t(is option B. es es but onl& i' &ou call t(e met(o openCursor#$ on t(e ResultSet an i' t(e river an atabase support t(is option C. *o ResultSets are never upateable. ou must e!plicitl& e!ecute DM- statements #i.e.insert elete an upate$ to c(ange t(e ata in t(e unerl&ing atabase. D. es but onl& i' t(e ResultSet is an obect o' class "pateableResultSet an i' t(e river an atabase support t(is option
Question 14 of 20 What statements are correct about positioned updates i.e. cursor updates! in $esult%ets
5.0/ 5.0 Points
A.nl& scrollable upateable ResultSets can use t(is approac( to c(ange t(e ata in t(e current ro3 o' a ResultSet B.4(e name o' t(e cursor c ursor is speci'ie b& t(e setCursor*ame#String name$ met(o t(e Statement obect. C."sing t(e cursor tec(niue is currentl& t(e on l& possible 3a& to c(ange t(e ata in t(e current ro3 o' a ResultSet D.+nsert statements are onl& supporte 3(en using scrollable cursors.
Question 15 of 20
0.0/ 5.0 Points
When the message 20o %uitable (river3 occurs
A. 6(en t(e t&pe river is use
B. 6(en t(e user name pass3or an t(e atabase oes not matc(
C. 6(en t(e river is not registere b& Class.'orname#$ met(o
D. 6(en t(e )DBC atabase "R- passe is not constructe properl&
Question 16 of 20 4ow is the for0ame! method of the 5Class5 class used with '()C?
5.0/ 5.0 Points
A. 4o loa a )DBC river
B. 4o establis( a atabase connection
C. 4o e!ecute a S%- statementresses
D. 4o loa a result set
Question 17 of 20 4ow can you e6ecute (7 statements i.e. insert, delete, update! in the database
5.0/ 5.0 Points
A. B& invo2ing t(e e! ecute+nsert#...$ e!ecuteDelete#...$ or e!ecute"pate#...$ met(os o' t(e DataMoi'icationStatement obect B. B& invo2ing t(e e!ecute#...$ or e!ecute"pate#...$ met(o o' a normal Statement obect or a sub,inter'ace obect t(ereo' C. B& ma2ing use o' t(e +nsertStatement DeleteStatement or "pateStatement classes
D. B& ma2ing use o' t(e e!ecute#...$ statement o' t(e DataMoi'icationStatement obect
5.0/ 5.0 Points
Question 18 of 20 What a correct ordering of steps should be to using a updatable recordset to insert new customers into the Customer table. +. &rompt user for customer information ). Call set methods for each column using customer information C. 6ecute statement %8 selecting the Customer table, return result set $9 (. Close %8 . +s# if more customers to add, if so go bac# to 55&rompt user55 :. Close connection ;. /pen connection to database 4. Close $9 ". Create statement %8 using %C$/+) and <&(+T+) <&(+T+) flags '. ;o to insert row of $9 =. Call $9.insert$ow
A. +898C8)8A8B8:8;8<8D8=
B. 98+8C8)8A8B8;8:8D8<8=
C. 98+8C8)8A8B8;8:8<8D8=
D. +898C8)8A8B8;8:8<8D8=
5.0/ 5.0 Points
Question 19 of 20 Which of the following statements will delete all records from the "nvoices table that have a value of > in the "nvoiceTotal field? %tring query 55(T :$/7 "nvoices 55 @ 55W4$ "nvoiceTotal "nvoiceTotal > 55A %tatement statement connection.create%tatement!A
A. statement.eleteRo3s#uer&$>
B. statement.elete#uer&$>
C. statement.e!ecute%ueruer&$>
D. statement.e!ecute"pate#uer&$>
Question 20 of 20 Which driver is called as thinBdriver in '()C
5.0/ 5.0 Points
A. 4&pe,? river
B. 4&pe,@ river
C. 4&pe, river
D. 4&pe,1 river
uestion 9 of D>
5.0/ 5.0 Points
+re prepared statements actually compiled
A. Yes, they compiled
B. No, they are bound by the JDBC drier
uestion D of D> Which interface of the '()C +&" e6ecutes preBcompiled % statements?
A. !esultset
B. "tatement
5.0/ 5.0 Points
C. Prepared"tatement Prepared"tatement
uestion 8 of D>
5.0/ 5.0 Points
Which java.sql class or interface is used to create a %tatement object? ?
A. Connection
B. Drier
C. Drier#ana$er
D. !esult"et
uestion * of D> 4ow is the for0ame! method of the 5Class5 class used with '()C?
A. %o load a JDBC drier
B. %o establish a database connection
5.0/ 5.0 Points
C. %o e&ecute a "'( statementresses
D. %o load a result set
uestion E of D>
0.0/ 5.0 Points
+ ________ object is used to submit a query to a database. ?
A. )aa.s*l
B. Connection.
C. dataset
D. "tatement.
uestion F of D> _______ helps manage the connection between the 'ava program and the database. ?
A. !esult"et
0.0/ 5.0 Points
B. "tatement.
C. Connection.
D. )aa.s*l
uestion G of D>
5.0/ 5.0 Points
What statements are correct about batched insert and updates? D correct answers!
A.%o A.%o do a batched update/insert, you call addBatch+"trin$ statement on a "tatement ob)ect -or each statement you ant to e&ecute in the batch
B.Batch insert and updates are only possible hen main$ use u se oparameteried *ueries.
C.%o e&ecute a batched update/insert, you call the e&ecuteBatch+ method on a "tatement ob)ect
D.%o D.%o create a batch o- insert and update statements, you create an ob)ect otype Batch, and call the method add"tatement+"trin$ statement -or each statement you ant to e&ecute in the batch
uestion H of D>
5.0/ 5.0 Points
4ow can you e6ecute (7 statements i.e. insert, delete, update! in the database
A. By inoin$ the e&ecute1nsert+..., e&ecute1nsert+..., e&ecuteDelete+... or e&ecute2pdate+... methods o- the Data#odi3cation"tatement Data#odi3cation"tatement ob)ect
B. By inoin$ the e&ecute+... or e&ecute2pdate+... e&ecute2pdate+... method o- a normal "tatement ob)ect or a sub4inter-ace ob)ect thereo-
C. By main$ use o- the 1nsert"tatement, Delete"tatement or 2pdate"tatement classes
D. By main$ use o- the e&ecute+... statement o- the Data#odi3cation"tatement Data#odi3cation"tatement ob)ect
uestion I of D>
5.0/ 5.0 Points
+re $esult%ets updateable
A. Yes, Yes, but only i- you indicate a concurrency strate$y hen e&ecutin$ the statement, and i- the drier and database support this option
B. Yes, Yes, but only i- you call the method openCursor+ on the !esult"et, and i- the drier and database support this option
C. No, !esult"ets are neer updateable. You must e&plicitly e&ecute D#(
statements +i.e.insert, delete and update to chan$e the data in the underlyin$ database.
D. Yes, Yes, but only i- the !esult"et is an ob)ect o- class 2pdateable!esult"et, and i- the drier and database support this option
uestion 9> of D>
5.0/ 5.0 Points
When you code an inner join in a %CT statement you do not need to specify ?
A. an !D6! BY clause
B. a )oin column -or the 3rst table
C. the name o- the second table
D. a )oin column -or the second table
uestion 99 of D> Which type of %tatement can e6ecute parameteriJed queries
A. Parameteried"tatement Parameteried"tatement
5.0/ 5.0 Points
B. Parameteried"tatement Parameteried"tatement and Callable"tatement
C. Prepared"tatement Prepared"tatement
D. All inds o- "tatements +i.e. hich implement a sub inter-ace o- "tatement
uestion 9D of D>
0.0/ 5.0 Points
+fter a %CT statement, a _________ is a logical table thatKs created temporarily within the database. ?
A. recordset
B. dataset
C. result set
D. datareader
uestion 98 of D> The result set retrieved by the following %CT statement contains records that have %CT )alance, 0um :$/7 +ccounts W4$ )alance L >
5.0/ 5.0 Points
?
A. to 3elds -rom the Balance table here Account Num is less than 0
B. one 3eld -rom the Balance table here Account Num is less than 0
C. to 3elds -rom the Accounts table here Balance is less than 0
D. all 3elds -rom the Accounts table here Balance is less than 0
uestion 9* of D>
5.0/ 5.0 Points
"f one intends to wor# with a $esult%et, which of these &repared%tatement methods will not wor#?
A. e&ecute2pdate+
B. e&ecute'uery+
C. e&ecute+
uestion 9E of D> Which of arguments are used by (river7anager.getConnectionM! D correct answers!
5.0/ 5.0 Points
A.databaseName7 %he database name
B.url7 Database url here stored or created your database
C.userName7 2ser name
D.portNumber7 the port number
uestion 9F of D> Which of following is wrong about Callable%tatement
A. %he ob)ect o- Callable"tatement Callable"tatement class can be created usin$ Connection.createCallable"tatement+ Connection.createCa llable"tatement+ method.
B. %he ob)ect o- Callable"tatement class can be created usin$ Connection.prepareCall+ Connection.prepareCall+ method.
C. %his inter-ace is used to e&ecute e&ecute "'( stored procedures.
D. %his e&tends Prepared"tatement Prepared"tatement inter-ace.
5.0/ 5.0 Points
uestion 9G of D>
5.0/ 5.0 Points
What happens if you call the method close! on a $esult%et object
A. You ill $et a "'(6&ception, because only "tatement ob)ects can close !esult"ets
B. %he !esult"et, to$ether ith the "tatement hich created it and the Connection -rom hich the "tatement as retrieed, ill be closed and release all database and JDBC resources
C. %he method close+ does not e&ist -or a !esult"et. nly Connections can be closed.
D. %he database and JDBC resources are released
uestion 9H of D> Which driver is called as thinBdriver in '()C
A. %ype48 drier
B. %ype49 drier
5.0/ 5.0 Points
C. %ype4: drier
D. %ype4; drier
uestion 9I of D>
5.0/ 5.0 Points
What is the meaning of the transaction isolation level T$+0%+CT"/0_$&+T+ T$+0%+CT"/0_$&+T+)_$+( )_$+(
A. Dirty reads are preented< non4repeatable reads and phantom reads can occur
B. Dirty reads, non4repeatable reads and phantom reads can occur
C. Dirty reads and non4repeatable reads are preented< phantom reads can occur
D. Dirty reads, non4repeatable reads and phantom reads are preented
uestion D> of D> Which of the following describes a '()C type * driver?
A. JDBC4DBC brid$e plus DBC drier
5.0/ 5.0 Points
B. Natie4AP1 partly Jaa drier
C. Natie4protocol pure Jaa drier
D. JDBC4Net pure Jaa drier
uestion 9 of D>
5.0/ 5.0 Points
=hat statements are correct about batched insert and updates> +9 correct ansers
A.%o A.%o do a batched update/insert, you call addBatch+"trin$ statement on a "tatement ob)ect -or each statement you ant to e&ecute in the batch
B.Batch insert and updates are only possible hen main$ use oparameteried *ueries.
C.%o e&ecute a batched update/insert, you call the e&ecuteBatch+ method on a "tatement ob)ect
D.%o create a batch o- insert and update statements, you create an ob)ect otype Batch, and call the method add"tatement+"trin$ statement -or each statement you ant to e&ecute in the batch
uestion D of D>
5.0/ 5.0 Points
=hich )aa.s*l class or inter-ace is used to create the ob)ect that is necessary -or callin$ stored procedures>
A. Callable"tatement
B. "tatement
C. !esult"et
D. Prepared"tatement Prepared"tatement
uestion 8 of D>
5.0/ 5.0 Points
?o many transaction isolation leels are de3ned in )aa.s*l.Connection inter-ace
A. 5
B. :
C. 9
D. 8
uestion * of D>
5.0/ 5.0 Points
A method that taes a "tudent ob)ect and rites it to the "tudent table in a database implements @@@@@@@@@@@. >
A. !esult"et#etaData !esult"et#etaData
B. connection poolin$
C. ! mappin$ +ob)ect to relational
D. init, destroy
uestion E of D>
5.0/ 5.0 Points
=hat statements are correct about positioned updates +i.e. cursor updates in !esult"ets
A.nly scrollable updateable !esult"ets can use this approach to chan$e the data in the current ro o- a !esult"et
B.%he name o- the cursor is speci3ed by the setCursorName+"trin$ name method the "tatement ob)ect.
C.2sin$ the cursor techni*ue is currently the only possible ay to chan$e the data in the current ro o- a !esult"et
D.1nsert statements are only supported hen usin$ scrollable cursors.
uestion F of D>
5.0/ 5.0 Points
1n Jaa, the result o- a "'( *uery is returned in a @@@@ ob)ect. >
A. !esult"et
B. JDBC
C. Command
D. Connection
uestion G of D>
0.0/ 5.0 Points
%he JDBC4DBC Brid$e Brid$e supports multiple concurrent concurrent open statements statements per connection
A. No
B. Yes
uestion H of D>
5.0/ 5.0 Points
=hat statements are correct about JDBC transactions +9 correct ansers>
A.A transaction is a set o- success-ully e&ecuted statements in the database
B.A transaction is 3nished hen commit+ or rollbac+ rollbac+ is called on the Connection ob)ect,
C.A transaction is 3nished hen commit+ or rollbac+ is called on the %ransaction %ransaction ob)ect
D.A transaction is 3nished hen close+ is called on the Connection ob)ect
uestion I of D>
=hich o- the -olloin$ is N% a ay to insert data into a table>
A. an 1N"6!% statement
B. a con3$uration 3le
0.0/ 5.0 Points
C. a "'( script
D. a (AD command
uestion 9> of D>
5.0/ 5.0 Points
=hich paca$es contain the JDBC classes
A. )aa.)dbc and )aa.)dbc.s*l
B. )aa.s*l and )aa&.s*l
C. )aa.)dbc and )aa&.)dbc
D. )aa.rdb and )aa&.rdb
uestion 99 of D>
5.0/ 5.0 Points
?o do you no in your Jaa pro$ram that a "'( arnin$ is $enerated as a result o- e&ecutin$ a "'( statement in the database
A. You You must catch the checed "'(6&ception hich is thron by the method hich e&ecutes the statement
B. You You must *uery the !esult"et ob)ect about possible arnin$s $enerated by the database
C. You You must inoe the $et=arnin$s+ $et=arnin$s+ method on the "tatement ob)ect +or a sub inter-ace thereo-
D. You must catch the uncheced "'(=arnin$6&ception hich is thron by the method hich e&ecutes the statement
uestion 9D of D>
)dbc.driers sun.)dbc.odbc.Jdbcdb sun.)dbc.odbc.JdbcdbcDrier cDrier %he Aboe statement7 ;. loads the JDBC4DBC brid$e driers 9. unloads the JDBC4DBC brid$e driers
A. ; and 9 are true.
B. ; and 9 are -alse
C. ; is true, 9 is -alse.
D. ; is -alse, 9 is true.
5.0/ 5.0 Points
uestion 98 of D>
5.0/ 5.0 Points
=hich o- the -olloin$ methods 3nds the ma&imum number o- connections that a speci3c drier can obtain
A. Database#etaData.$et#a Database#etaData.$et#a&Connections &Connections
B. Database.$et#a&Connections
C. Connection.$et#a&Connections
D. !esult"et#etaData.$et#a&Connectio !esult"et#etaData.$et#a&Connections ns
uestion 9* of D>
=hich drier is called as thin4drier in JDBC
A. %ype48 drier
B. %ype49 drier
C. %ype4: drier
5.0/ 5.0 Points
D. %ype4; drier
uestion 9E of D>
5.0/ 5.0 Points
JDBC de3nes Jaa Classes -or7 >
A. !esult sets
B. All o- the other ansers
C. Database metadata, Database connection
D. "'( statements
uestion 9F of D>
5.0/ 5.0 Points
?o can you e&ecute D#( statements +i.e. insert, delete, update in the database
A. By inoin$ the e&ecute1nsert+..., e&ecute1nsert+..., e&ecuteDelete+... or e&ecute2pdate+... methods o- the Data#odi3cation"ta Data#odi3cation"tatement tement ob)ect
B. By inoin$ the e&ecute+... e&ecute+... or e&ecute2pdate+... method o- a normal
"tatement ob)ect or a sub4inter-ace ob)ect thereo-
C. By main$ use o- the 1nsert"tatement, Delete"tatement or 2pdate"tatement classes
D. By main$ use o- the e&ecute+... e&ecute+... statement o- the Data#odi3cation"tatement Data#odi3cation"ta tement ob)ect
uestion 9G of D>
5.0/ 5.0 Points
=hat is the meanin$ o- !esult"et.%YP6@"C!((@1N"6N"1%16 !esult"et.%YP6@"C!((@1N"6N"1%16
A. %his means that the !esult"et is sensitie to scrollin$, but insensitie to chan$es made by others
B. %his means that the !esultset is sensitie to scrollin$, but insensitie to updates, i.e. not updateable
C. %he meanin$ depends on the type o- data source, and the type and ersion o- the drier you use ith this data source
D. %his means that the !esult"et is insensitie to scrollin$
uestion 9H of D>
5.0/ 5.0 Points
=hich )aa.s*l class or inter-ace contains methods that enable you to 3nd out the
number o- columns this is returned in a !esult"et and the name or label -or a $ien column> >
A. "tatement
B. #etaData
C. Callable"tatement
D. !esult"et#etaData !esult"et#etaData
uestion 9I of D>
5.0/ 5.0 Points
=hen you code an inner )oin in a "6(6C% statement you do not need to speci-y >
A. an !D6! BY clause
B. a )oin column -or the 3rst table
C. the name o- the second table
D. a )oin column -or the second table
uestion D> of D>
5.0/ 5.0 Points
=hich drier is ecient and alays pre-erable -or usin$ JDBC applications
A. %ype ;
B. %ype 9
C. %ype :
D. %ype 8
5.0/ 5.0 Points uestion 9 of D>
The column inde6 of $esult%et object is numbered from _________
A. Yes
B. No
uestion D of D>
0.0/ 5.0 Points
+fter a %CT statement, a _________ is a logical table thatKs created temporarily within the database. ?
A. result set
B. datareader
C. recordset
D. dataset
uestion 8 of D>
5.0/ 5.0 Points
Which statements about '()C are true D correct answers!
A.JDBC is an AP1 to connect to relational4, ob)ect4 and E#( data sources
B.JDBC is an AP1 to brid$e the ob)ect4relational ob)ect4relational mismatch beteen pro$rams and relational databases
C.JDBC is an AP1 to access relational databases, spreadsheets and Fat 3les
D.JDBC stands -or Jaa DataBase Connectiity
uestion * of D>
0.0/ 5.0 Points
The different types of '()C driver are
A.Natie4AP1, A.Natie4AP1, partly Jaa drier
B.Natie4AP1, pure Jaa drier
C.Jdbc4odbc brid$e, plus odbc drier
D.Jdbc4net, pure Jaa drier
uestion E of D>
5.0/ 5.0 Points
Which java.sql class or interface contains methods that enable you to find out the number of columns this is returned in a $esult%et and the name or label for a given column? ?
A. "tatement
B. #etaData
C. Callable"tatement
D. !esult"et#etaData !esult"et#etaData
uestion F of D>
5.0/ 5.0 Points
Which method is used to perf orm (7 statements in '()C
A. e&ecute'uery+
B. e&ecute!esult+
C. e&ecute2pdate+ e&ecute2pdate+
D. e&ecute+
5.0/ 5.0 Points uestion G of D>
What happens if you call the method close! on a $esult%et object
A. %he !esult"et, to$ether ith the "tatement hich created it and the Connection -rom hich the "tatement as retrieed, ill be closed and release all database and JDBC resources
B. You You ill $et a "'(6&ception, because only "tatement ob)ects can close !esult"ets
C. %he database and JDBC resources are released
D. %he method close+ does not e&ist -or a !esult"et. nly Connections can be closed.
uestion H of D> Which driver is called as thinBdriver in '()C
A. %ype49 drier
B. %ype48 drier
C. %ype4: drier
5.0/ 5.0 Points
D. %ype4; drier
uestion I of D>
5.0/ 5.0 Points
What happens if you call delete$ow! on a $esult%et object
A. %he ro you are positioned on is deleted -rom the !esult"et, but not -rom the database.
B. %he ro you are positioned on is deleted -rom the !esult"et and -rom the database
C. You You ill $et a compile error7 the method does not e&ist because you can not delete ros -rom a !esult"et
D. %he result depends on hether the property synchronie=ithData"ource synchronie=ithData"ource is set to true or -alse
uestion 9> of D>
5.0/ 5.0 Points
4ow can you retrieve information from a $esult%et
A. By inoin$ the special $etter methods on the !esult"et7 $et"trin$+..., $et"trin$+..., $etBoolean +..., $etClob+...,G
B. By inoin$ the method $etalue+..., $etalue+..., and cast the result to the desired Jaa type.
C. By inoin$ the method $et+..., %ype type on the !esult"et, here %ype is an ob)ect hich represents a database type
D. By inoin$ the method $et+..., "trin$ type on the !esult"et, here type is the database type
uestion 99 of D>
5.0/ 5.0 Points
+re $esult%ets updateable
A. Yes, Yes, but only i- you indicate a concurrency strate$y hen e&ecutin$ the statement, and i- the drier and database support this option
B. Yes, Yes, but only i- the !esult"et is an ob)ect o- class 2pdateable!esult"et, and i- the drier and database support this option
C. Yes, Yes, but only i- you call the method openCursor+ on the !esult"et, and i- the drier and database support this option
D. No, !esult"ets are neer updateable. You must e&plicitly e&ecute D#( statements +i.e.insert, delete and update to chan$e the data in the underlyin$ database.
uestion 9D of D>
5.0/ 5.0 Points
To improve the performance of database operations, an application can use _________ where a limited number of connections are opened and are shared by users of the database. ?
A. !esult"et#etaData !esult"et#etaData
B. ! mappin$ +ob)ect to relational
C. init
D. connection poolin$
uestion 98 of D> Which pac#ages contain the '()C classes
A. )aa.)dbc and )aa&.)dbc
B. )aa.s*l and )aa&.s*l
C. )aa.)dbc and )aa.)dbc.s*l
5.0/ 5.0 Points
D. )aa.rdb and )aa&.rdb
uestion 9* of D>
5.0/ 5.0 Points
Which of following is wrong about Callable%tatement
A. %his inter-ace is used to e&ecute "'( stored procedures.
B. %his e&tends Prepared"tatement inter-ace.
C. %he ob)ect o- Callable"tatement class can be created usin$ Connection.prepareCall+ Connection.prepareCall+ method.
D. %he ob)ect o- Callable"tatement class can be created usin$ Connection.createCallable"tatement+ Connection.createCa llable"tatement+ method.
uestion 9E of D> '()C defines 'ava Classes forN ?
A. Database metadata, Database connection
B. !esult sets
5.0/ 5.0 Points
C. All o- the other ansers
D. "'( statements
uestion 9F of D>
5.0/ 5.0 Points
The methods of what type of object can be used to move the cursor through a result set? ?
A. !esult"et
B. "tatement
C. 2!(
D. Connection
uestion 9G of D> The '()CB/()C bridge is
A. %hree tiered
B. #ultithreaded
0.0/ 5.0 Points
C. Best -or any plat-orm
D. All o- the aboe
uestion 9H of D>
5.0/ 5.0 Points
The class java.sql.Timestamp has its super class as
A. )aa.s*l.%ime
B. )aa.util.Date
C. )aa.util.%ime
D. None o- the aboe
uestion 9I of D> Which of these operations are provided by (7 (ata 7anipulation anguage? ?
A. Creatin$ H deletin$ a table
0.0/ 5.0 Points
B. Creatin$ table
C. 1nsertin$ data and updatin$ data
D. 6ncodin$ the data
uestion D> of D>
5.0/ 5.0 Points
The _______ class is traditional management layer of '()C, wor#ing between the user and the drivers
A. Connection
B. Drier#ana$er
C. !esultset
JDBC Objective Questions
%ee These uestions 9. Which statements about '()C are true? D answers! OaP '()C is an +&" to connect to relationalB, objectB and Q7 data sources ObP '()C stands for 'ava (ata)ase Connectivity OcP '()C is an +&" to access relational databases,
spreadsheets and flat files OdP '()C is an +&" to bridge the objectBrelational mismatch between // programs and relational databases
D. Which pac#ages contain the '()C classes? a! java.jdbc and java6.jdbc b! java.jdbc and java.jdbc.sql c! java.sql and java6.sql d! java.rdb and java6.rdb 8. Which type of driver provides '()C access via one or more /()C drivers? a! Type 9 driver b! Type D driver c! Type 8 driver d! Type * driver *. Which type of driver converts '()C calls into the networ# protocol used by the database management system directly? a! Type 9 driver
b! Type D driver c! Type 8 driver d! Type * driver E. Which type of %tatement can e6ecute parameteriJed queries? a! &repared%tatement b! &arameteriJed%tat &arameteriJed%tatement ement c! &arameteriJed%tatem &arameteriJed%tatement ent and Callable%tateme Callable%tatement nt d! +ll #inds of %tatements i.e. which implement a sub interface of %tatement! F. 4ow can you retrieve information from a $esult%et? a! )y invo#ing the method get..., %tring type! on the $esult%et, where type is the database type b! )y invo#ing the method get..., Type Type type! on the $esult%et, where Type Type is an object which represents a database type c! )y invo#ing the method get1alue...!, and cast the result to the desired 'ava type.
d! )y invo#ing the special getter methods on the $esult%etN get%tring...!, get)oolean ...!, getClob...!,... G. 4ow can you e6ecute (7 statements i.e. insert, delete, update! in the database? a! )y ma#ing use of the "nsert%tatement, (elete%tatement or
H. 4ow do you #now in your 'ava program that a % warning is generated as a result of e6ecuting a % statement in the database? a! -ou must catch the chec#ed %6ception which is thrown by the method which e6ecutes the statement b! -ou must catch the unchec#ed %Warning6ception which is thrown by the method which e6ecutes
the statement c! -ou must invo#e the getWarnings! method on the %tatement object or a sub interface thereof! d! -ou must query the $esult%et object about possible warnings generated by the database
I. What is, in terms of '()C, a (ata%ource? a! + (ata%ource is the basic service for managing a set of '()C drivers b! + (ata%ource (ata%ource is the 'ava representation of a physical data source c! + (ata%ource (ata%ource is a registry point for '0("Bservices d! + (ata%ource is a factory of connections to a physical data source
9>. What is the meaning of $esult%et.T-&_%C$/_"0%0%"T"1 a! This means that the $esult%et is insensitive to scrolling b! This means that the $esultset is sensitive to scrolling, but insensitive to updates, i.e. not updateable c! This means that the $esult%et is sensitive to scrolling, but insensitive to changes made by others d! The meaning depends on the type of data source, and the type and version of the driver you use with this data source
99. +re $esult%ets updateable? a! -es, -es, but only if you call the method openCursor! on the $esult%et, and if the driver and database support this option b! -es, but only if you indicate a concurrency strategy when e6ecuting the statement, and if the driver and database support this option c! -es, but only if the $esult%et is an object of class
9D. What statements are correct about '()C transactions D correct answers!? OaP + transaction is a set of successfully e6ecuted statements in the database ObP + transaction is finished when commit! or rollbac#! is called on the Connection object, OcP + transaction is finished when commit! or rollbac#! is called on the Transaction object OdP + transaction is finished when close! is called on the Connection object.
98. 4ow can you start a database transaction in the database? a! )y as#ing a Transaction Transaction object to your Connection, and calling the method begin! on it b! )y as#ing a Transaction Transaction object to your Connection, and setting the autoCommit property of the Transaction Transaction to false c! )y calling the method beginTransaction! beginTransaction! on the Connection object d! )y setting the autoCommit property of the Connection to false, and e6ecute a statement in the database
9*. What is the meaning of the transaction isolation level T$+0%+CT"/0_$&+T+)_$+( a! (irty reads, nonBrepeatable reads and phantom reads can occur b! (irty reads are preventedA nonBrepeatable reads and phantom reads can occur c! (irty reads and nonBrepeatable reads are preventedA phantom reads can occur d! (irty reads, nonBrepeatable reads and phantom reads are prevented
9E. What statements are correct about positioned updates i.e. cursor updates! in $esult%ets? D
correct answers! OaP
9F. 4ow can you e6ecute a stored procedure in the database? a! Call method e6ecute! on a Callable%tatement object b! Call method e6ecute&rocedure! on a %tatement object c! Call method e6ecute! on a %tored&rocedure object d! Call method run! on a &rocedureCommand object
9G. What happens if you call the method close! on a $esult%et object? a! the method close! does not e6ist for a $esult%et. /nly Connections can be closed. b! the database and '()C resources are released c! you will get a %6cep %6ception, tion, because only %tatement
objects can close $esult%ets d! the $esult%et, together with the %tatement which created it and the Connection from which the %tatement was retrieved, will be closed and release all database and '()C resources
9H. What happens if you call delete$ow! on a $esult%et object? a! The row you are positioned on is deleted from the $esult%et, but not from the database. b! The row you are positioned on is deleted from the $esult%et and from the database c! The result depends on whether the property synchroniJeWith(ata%ource synchroniJeWi th(ata%ource is set to true or false d! -ou will get a compile errorN the method does not e6ist because you can not delete rows from a $esult%et
9I. What statements are correct about batched insert and updates? D answers! OaP To create a batch of insert and update statements, you create an object of type )atch, and call the method add%tatement%tring statement! for each statement you want to e6ecute in the batch ObP )atch insert and updates are only possible when ma#ing use of parameteriJed queries. OcP To do a batched updateRinsert, you call add)atch%tring
statement! on a %tatement object for each statement you want to e6ecute in the batch OdP To e6ecute a batched updateRinsert, you call the e6ecute)atch! method on a %tatement object
D>. What is correct about (( statements create, grant,...!? a! (( statements statements are treated as normal % statements, and are e6ecuted by calling the e6ecute! method on a %tatement or a sub interface thereof! object b! To e6ecute (( statements, you have to install additional support files c! (( statements can not be e6ecuted by ma#ing use of '()C, you should use the native database tools for this. d! %upport for (( statements will be a feature of a future release of '()C
D9. The '()CB/()C )ridge supports multiple concurrent open statements per connection? a. True b. :alse
DD. Which of the following allows non repeatable read in '()C Connection? a. T$+0%+CT"/0_$ T$+0%+CT"/0_$+(_<0C/77"TT( +(_<0C/77"TT(
b. T$+0%+CT"/0_$ T$+0%+CT"/0_$+(_C/77"TT( +(_C/77"TT( c. T$+0%+CT"/0_ T$+0%+CT"/0_%$"+"S+) %$"+"S+) d. T$+0%+CT"/0_ T$ +0%+CT"/0_$&+T $&+T+)_$+( +)_$+(
D8. Which of the following statements is false as far as different type of statements is concern in '()C? a. $egular %tatement b. &repared %tatement c. Callable %tatement d. "nterim %tatement D*. Which of the following methods are needed for loading a database driver in '()C? a. register(river! method b. Class.for0ame! c. )oth + and ) d. getConnection!
DE. Which of the following is false as far as type * driver is concern? a. Type Type * driver is 2native protocol, pure java3 driver b. Type * drivers are 9>> 'ava compatible c. Type * drivers uses %oc#et class to connect to the database d. Type * drivers can not be used with 0etscape
DF. To e6ecute a stored procedure 2total%toc#3 in a database server, which of the following code snippet is used? a. %tatement stmt connection.create%tatement!Astmt.e6ec connection.create% tatement!Astmt.e6ecute5total%toc#!5!A ute5total%toc#!5!A b. Callable%tatement clbstmnt con.prepareCall5Ucall total%toc#V5!Acs.e6ecuteuery!A c. %tore&rocedure%tateme %tore&rocedure%tatement nt stmtconnection.create%tore&rocedure5tota stmtconnecti on.create%tore&rocedure5total%toc#!5!Aspst l%toc#!5!Aspst mt.e6ecuteuery!A d. &repare%tatement pstmt connection.prepare%tatement5total%toc#!5!Apstmt.e6ecut e!A
DG. Which driver is efficient and always preferable for using '()C applications? a. Type * b. Type 9 c. Type 8 d. Type D
DH. '()C facilitates to store the java objects by using which of the methods of &repared%tatement set/bject ! D. set)lob! 8. setClob!
a. 9, D b. 9,D,8 c. 9,8 d. D,8
DI. Which statement is static and synchroniJed in '()C +&"? a. e6ecuteuery! b. e6ecute
8>. The '()CB/()C bridge is a. Three tiered b. 7ultithreaded c. )est for any platform d. +ll of the above
89. +ll +ll raw data types including binary documents or images! should be read and uploaded to the database as an array of a. byte b. int c. boolean d. char
8D. The class java.sql.Timestamp has its super class as a. java.sql.Time b. java.util.(ate c. java.util.Time d. 0one of the above
88. )/), C/), +$$+- and $: type columns can be updated in a. '()C 9.> b. '()C *.> c. '()C D.> d. '()C 8.>
8*. Which of the following methods finds the ma6imum number of connections that a specific driver can obtain? a. (atabase.get7a6Conne (atabase.get7a6Connections ctions b. Connection.get7a6Co Connection.get7a6Connections nnections c. (atabase7eta(ata.get7 (atabase7eta(ata.get7a6Connections a6Connections d. $esult%et7eta(ata $esult%et7eta(ata.get7a6Connections .get7a6Connections
8E. +re prepared statements actually compiled? a. -es, they compiled b. 0o, they are bound by the '()C driver
8F. When the message 20o %uitable (river3 occurs? a. When the driver is not registered by Class.forname! method b. When the user name, password and the database does not match c. When the '()C database <$ passed is not constructed properly d. When the type * driver is used
8G. Which driver is called as thinBdriver in '()C? a. TypeB* driver b. TypeB9 driver c. TypeB8 driver d. TypeBD driver
8H. 4ow many transaction isolation levels are defined in java.sql.Connection java.sql.Connec tion interface? a. * b. 8 c. E d. D
8I. Which method is used to perform (7 statements in
'()C? a. e6ecute! b. e6ecuteuery! c. e6ecute
*>. What is the disadvantage of TypeB* 0ativeB&rotocol (river? a. +t +t client side, a separate driver is needed for each database. b. TypeB* driver is entirely written in 'ava c. The driver converts '()C calls into vendorBspecific database protocol d. "t does not support to read r ead 7y% data. data. Part 1 of 1 -
;00.0/ ;00.0 Points
uestion 9 of D>
5.0/ 5.0 Points
%he @@@@@@ inter-ace inter-ace communicates ith the database, database, either directly directly or thou$ht another database speci3c drier. drier. >
A. Direct#ana$er
B. Drier
C. "tatement
D. Connection
uestion D of D>
5.0/ 5.0 Points
=hat is the meanin$ o- the transaction isolation leel %!AN"AC%1N@!6P6A %!AN"AC%1N@!6P6A% %AB(6@!6AD
A. Dirty reads, non4repeatable reads reads and phantom reads can occur
B. Dirty reads, non4repeatable reads and phantom reads are preented
C. Dirty reads are preented< non4repeatable reads and phantom reads can occur
D. Dirty reads and non4repeatable reads are preented< phantom reads can occur
uestion 8 of D>
5.0/ 5.0 Points
1- one intends to or ith a !esult"et, hich o- these Prepared"tatement methods ill not or>
A. e&ecute'uery+
B. e&ecute+
C. e&ecute2pdate+ e&ecute2pdate+
uestion * of D>
5.0/ 5.0 Points
=hat is, in terms o- JDBC, a Data"ource
A. A Data"ource is a -actory o- connections to a physical data source
B. A Data"ource is the basic serice -or mana$in$ a set o- JDBC driers
C. A Data"ource is a re$istry point -or JND14serices
D. A Data"ource is the Jaa representation o- a physical data source
uestion E of D>
5.0/ 5.0 Points
%o %o improe the per-ormance per-ormance o- database database operations, an application application can use @@@@@@@@@ here here a limited number oo- connections are opened opened and are shared shared by users o- the database. >
A. !esult"et#etaData !esult"et#etaData
B. ! mappin$ +ob)ect to relational
C. init
D. connection poolin$
uestion F of D>
5.0/ 5.0 Points
=hat is type4; o- JDBC driers
A. Natie4AP1/partly Jaa drier +Natie
B. JDBC4DBC Brid$e drier +Brid$e
C. All Jaa/Net4protoc J aa/Net4protocol ol drier +#iddleare +#iddleare
D. All Jaa/Natie4protocol drier +Pure
5.0/ 5.0 Points uestion G of D>
Conn Drier #ana$er.$etConnection+I)dbc7odbc #ana$er.$etConnection+I)dbc7odbc76mployee,I,I< 76mployee,I,I< =hat does the aboe statement do>
A. Kets connectioned to the employee database.
B. !etriees data -rom the employee table.
C. Kets a database connection ith the 6mployee data source.
D. 1nidicates that )dbc is to be used in the application.
uestion H of D>
?o is the -orName+ method o- the LClassL class used ith JDBC>
A. %o e&ecute a "'( statementresses
B. %o load a JDBC drier
C. %o load a result set
5.0/ 5.0 Points
D. %o establish a database connection
uestion I of D>
5.0/ 5.0 Points
=hen the messa$e INo "uitable Drier occurs
A. =hen the drier is not n ot re$istered by Class.-orname+ method
B. =hen the type : drier is used
C. =hen the JDBC database 2!( passed is not constructed properly
D. =hen the user name, passord and the database does not match
uestion 9> of D>
5.0/ 5.0 Points
%he methods o- hat type type o- ob)ect can can be used to moe the cursor throu$h a result set> >
A. !esult"et
B. "tatement
C. 2!(
D. Connection
uestion 99 of D>
5.0/ 5.0 Points
=hich )aa.s*l class proides the $etConnection+ method>
A. !esult"et M;
B. Connection
C. Drier#ana$er
D. Drier
uestion 9D of D>
5.0/ 5.0 Points
A method that taes a "tudent ob)ect and rites it to the "tudent table in a database implements @@@@@@@@@@@. >
A. init, destroy
B. ! mappin$ +ob)ect to relational
C. connection poolin$
D. !esult"et#etaData !esult"et#etaData
uestion 98 of D>
5.0/ 5.0 Points
All ra data types +includin$ binary documents or ima$es should be read and uploaded to the database as an array o-
A. Boolean
B. int
C. byte
D. Char
uestion 9* of D>
5.0/ 5.0 Points
=hich o- the -olloin$ statements is -alse as -ar as dierent type o- statements is concern in JDBC
A. !e$ular "tatement
B. Prepared "tatement
C. Callable "tatement
D. 1nterim "tatement
uestion 9E of D>
5.0/ 5.0 Points
=hat statements are correct about positioned updates +i.e. cursor updates in !esult"ets
A.nly scrollable updateable !esult"ets can use this approach to chan$e the data in the current ro o- a !esult"et
B.2sin$ the cursor techni*ue is currently the only possible ay to chan$e the data in the current ro o- a !esult"et
C.1nsert statements are only supported hen usin$ scrollable cursors.
D.%he name o- the cursor is speci3ed by the setCursorName+"trin$ name
method the "tatement ob)ect.
uestion 9F of D>
5.0/ 5.0 Points
=hat a correct orderin$ o- steps should be to updatin$ the rders and the Customers tables, all ithin the same transaction7 A. Commit B. Close "; C. e&ecute "; D. Create a statement "; to update rders 6. Create a statement "9 to update Customers O. e&ecute "9 K. Close connection ?. Close "9 1. pen connection to the database J. "et auto commit to -alse . "et auto commit to true
A. 1@D@6@C@J@O@A@B@?@@K 1@D@6@C@J@O@A@B@?@@K
B. 1@D@6@J@C@O@A@B@?@@K 1@D@6@J@C@O@A@B@?@@K
C. 1@6@D@J@C@O@A@B@?@@K 1@6@D@J@C@O@A@B@?@@K
D. 1@D@6@J@C@O@A@B@?@K@ 1@D@6@J@C@O@A@B@?@K@
uestion 9G of D>
=hich type o- "tatement can e&ecute parameteried *ueries
5.0/ 5.0 Points
A. Prepared"tatement Prepared"tatement
B. All inds o- "tatements +i.e. hich implement a sub inter-ace o- "tatement
C. Parameteried"tatement and Callable"tatement
D. Parameteried"tatement Parameteried"tatement
uestion 9H of D>
5.0/ 5.0 Points
=hich o- the -olloin$ methods are needed -or loadin$ a database drier in JDBC
A. re$isterDrier+ method
B. Both A and B
C. $etConnection+
D. Class.-orName+
5.0/ 5.0 Points uestion 9I of D>
A 3le that stores one or more "'( statements is non as a @@@@@@@@@. >
A. "'( script
B. result set
C. connection
D. "'( statement
uestion D> of D>
1n Jaa, the result o- a "'( *uery is returned in a @@@@ ob)ect. >
A. JDBC
B. Connection
C. Command
5.0/ 5.0 Points
D. !esult"et