0% found this document useful (0 votes)
3 views

AJP Unit-5

The document contains a series of questions and answers related to Java Database Connectivity (JDBC) and SQL, covering topics such as JDBC drivers, SQL exceptions, and methods for executing SQL statements. It includes multiple choice questions about the functionality of JDBC components, syntax for database operations, and the handling of SQL queries. The content appears to be part of an educational material or exam preparation for advanced Java programming.

Uploaded by

Sahil Tarle
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
3 views

AJP Unit-5

The document contains a series of questions and answers related to Java Database Connectivity (JDBC) and SQL, covering topics such as JDBC drivers, SQL exceptions, and methods for executing SQL statements. It includes multiple choice questions about the functionality of JDBC components, syntax for database operations, and the handling of SQL queries. The content appears to be part of an educational material or exam preparation for advanced Java programming.

Uploaded by

Sahil Tarle
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 3
Package contains cl, a database, sending con 6 SQL to the database and process the query req -(a)_connection.sql (b) db sal ne Q.2 Which of the following is not a (a) 100% pure Java Driver (b) JDBC net pure Java Driver (c) JDBC— Native API driver UT” 108C— Native pure tava Driver In JDBC that are concern with Datal (2) , javax.sql Ale” java.sal type of JDBC driver? a3 imports all Java classes base connectivi (b) java.mysql (2) comsql Q.4 Database programming using Java throws which of the following exception ? (a) SQLException (b) ClassNotFoundException. (c) None of these \(a)’ “Both of these Q.5 In the below statement, which type of query can be used with executeUpdate( ) method. statement. executeUpdate(query here) \{a° Insert, Update, Delete (b) Insert, Select, Delete (c)_ Only Select (4) Any Query Q.6 Whatis purpose of next( ) method? (a) toretain the next element in a series. (b) to retain next table. eV’ to retain next record in a series. None of the above () 1.7. Native ~ protocol pure Java Driver converts into the directly. (a) JDBC calls, network protocol (b) 008C class, network protocol (6) O08C class, user catls NIG’ 108 calls, user calls 8 Choose the correct. syntax for getConnection( ) method. (a) public static Connection getConnection(String Ut), String password) throws SQLException Public static Connection getConnection(String name, String password) throws SQLException Uc public static Connection getConnection(String url, String name, String password) throws SQLException public static Connection getConnection(String, url, String name) throws SQLException Q.9 SQL stands for. 2 al” Structured Query Language (b) Sequential Query Language (c) Structured Question Language (d) Sequential Question Language Q10 _______isatable of data which represents a data from table. (a) Metabata (b) ResultSetMetaData \ (ResultSet. (a) Statement Q, 11 Public class DriverManager extends. UF Object (b) © string (c) Connection (d) Statement: Q.12 Which of the following method is supported by statement interface? {a) public boolean execute(String query) (b) public ResultSet executeQuery(String query) (c)__ public int executeUpdate(String query) ay" of above (b) (d) WF Advanced Java Programming (MSBTE) M5.2 © 13 In following statement rs is an object of interface of JDBC API. System out printin(rs.getstring(3}); z (2) Rowset (6) Statement () Connection NOP Resultset Q.14 Which is main component of JOBC API? (a) DriverManager (b) Driver (©) Connection (WY all of these Qis nom Many steps are used to connect any java application with the database using JDBC ? Ud s (b) 4 () 3 (d) 6 2-16 ODBC minimum Sat grammer contains (2) Stored procedure (b) Data, Time and Timestamp only (0) | create or drop View NI” insert, update, delete only 9-17 Which class/interface is used for an SQL statement that is executed frequently? (a) Statement (b) Caltablestatement N(o" Preparedstatement (d) None of the above 418 What does the following code do con.createStatement( ) (2) A Preparedstatement object is created to send SQL commands to database. NAb] A Statement object is created to send Sat commands to database. (c) A Callablestatement is created to send sai ‘commands to database. (d) A Statement object is created to execute Parameterized SQL commands. smt = Q.19 Which kind of driver converts JDBC calls into calls on the Client API for Oracle, Sybase, informix, IBM DB2, or other DBMS (a) JDBC ODBC bridge + ODBC Driver (bf Native API partly —Java Driver (c) JDBC-Net pure Java Driver (d)_ Native Protocol Pure Java Driver Q. 20 Which method executes an SQL statement that may return multiple results? (a) executeUpdate) (bf executeauery() Interacting with Database 21 Identify correct syntax of executeduery( ) of Statement interface. (a) public static ResultSet executequery{ ) Mot’ public ResultSet executeQuery(String q) (c)_ public void executeQuery(String q) (4) public int executeQuery(string q) Q.22 Native API converts into the used by DBMS. (a) JDBC API, Network Protocol JDBC API, Native API calls {c)_ JDBC API, use calls (a) J08C API, ODBC AP calls Q.23 Which of the following function is used to find the column count of the particular ResultSet. (a) getMetadata() _—(b)_metadatal) NteY” getColumncount() (4) getCount( ) @.24 The JDBC-OD8C bridge supports how many concurrent open statements per connection ? Ne 2 (b) 0 (6) Does not support connection {@) None of these method to create Q.25 Select the correct Callablestatement. (a) Callablestatement prepareCall(String sql) {b) CallableStatement prepareCall(String sql, int resultset type, int resultset_concurrency) (c) CallableStatement prepareCall(String sql, int resultset_type, int resultset_concurrency, int _, Fesultset_holdability) of the above Q..26 Microsoft Access data in —file format. (a) OAT i) MDB () sau (a) 08) Q.27 Which of the following method is used for send SL statements? (a) Statement (b) Callablestatement. (c) “Preparedstatement “(dy Both B &C 0.28 DELETE ‘statement of an SQL is “executed . by (a) execute() "(G7 executeUpdate( ) (b) (a) executeuery() executeDeletet } (ce) execute() (4) no€xecute( } #_Advanced Java Programming (MsBTe) 5.3 fa.22 The Interface to. the -datshate is hanae by (a) ODBC Ne sec. (c) JDBC & ODBC (d) APIs 0.30 DatabaseMetadata are retrieveg through WE getdatabasemetadatal) (b) getMetabatal ) (Q)_ getDBMetaDatal ) {d) getDatabaseMetal) ; @.31 Which method is used to retrieve the Resutset created? AS executeQuery( ) (b) getResultSet{ ) Interacting with Database (©) _getResultsetResutt() {d) getResutt( ) 0. 32 Which of the following is used generally for reading the content of the database? (2) _DabaseData (b) DabaseData NO Resultset (d) DatabaseResult Q.33 The syntax to create a table named “Course”, should begin with (a) create new table course create table course (c) table course create (a) new table course Baza e (a). (a3 Qaé () Q7 (d) as Q.11 (a) Q42 (d) © Q.23 Q16 (d) Q17 () Q18 Q.21 (b) Q.22 (b) Q23 Q.26 (b) Q27 (d) Q28 Q.31 (a). Q.32 (c) ~~ Q.33 © a4 @ as @) i) ae @ a1 ©) (2) 14 le) 48 | (by Q19° (b) 9.20 le HOt gar t 025 (a) (9.29 () 030 De aac

You might also like