Advance JAVA Programming (3360701) MCQs

MCQs of Java Data Base Connectivity (JDBC)

Showing 21 to 30 out of 33 Questions
21.

Which package needs to import to make database connection in java?

Java માં ડેટાબેઝ કનેક્શન માટે ક્યા પેકેજ ને ઈમ્પોર્ટ કરવાની જરૂર પડે છે?

(a)

import java.util.*;

(b)

import java.JDBC.*;

(c)

import java.sql.*;

(d)

None of given

આપેલમાંથી એકપણ નહિ

Answer:

Option (c)

22.
Which of the following is used to call stored procedure?
સ્ટોર્ડ પ્રોસીજર કોલ કરવા માટે નીચે આપેલ માંથી કયો વિકલ્પ ઉપયોગી છે?
(a) PreparedStatement
PreparedStatement (પ્રીપેર્ડ સ્ટેટમેન્ટ)
(b) CallableStatment
CallableStatment (કોલેબલ સ્ટેટમેન્ટ)
(c) Statement
Statement (સ્ટેટમેન્ટ)
(d) CalledStatement
CalledStatement (કોલ્ડ સ્ટેટમેન્ટ)
Answer:

Option (b)

23.

Which of the following method used to execute SELECT Query?

SELECT ક્વેરી એક્ઝીક્યુટ કરવા માટે કઈ મેથડ ઉપયોગી છે?

(a)

execute()

(b)

executeQuery()

(c)

Both execute() & executeQuery()

execute() અને executeQuery() બંને

(d)

None of given

આપેલમાંથી એકપણ નહિ

Answer:

Option (c)

24.

Which of the following method used to execute UPDATE() query?

UPDATE ક્વેરી એક્ઝીક્યુટ કરવા માટે કઈ મેથડ ઉપયોગી છે?

(a)

execute()

(b)

executeUpdate()

(c)

executeQuery()

(d)

Both execute() & executeUpdate()

execute() અને executeUpdate() બંને

Answer:

Option (d)

25.
The performance of the application will be faster if you use PreparedStatement interface because query is compiled only once.
જો પ્રીપેર્ડ સ્ટેટમેન્ટ (PreparedStatement) ઇન્ટરફેસ નો ઉપયોગ કરવામાં આવે તો એપ્લીકેશનનું પરફોર્મન્સ ઝડપી બને છે કારણ કે ક્વેરી ફક્ત એકજ વખત કમ્પાઈલ થાય છે.
(a) true
(b) False
false
Answer:

Option (a)

26.

Which of the following is an advantage of using PreparedStatement in Java?

Java માં પ્રીપેર્ડ સ્ટેટમેન્ટ (PreparedStatement) નો ઉપયોગ કરવાથી નીચે આપેલ માંથી કયા ફાયદા થાય છે?

(a)

Slow performance

સ્લો પરફોર્મન્સ

(b)

Prevents SQL injection

SQL ઇન્જેક્શન ને પ્રીવેન્ટ કરે છે.

(c)

Encourages SQL injection

SQL ઇન્જેક્શન ને એન્કરેજ કરે છે.

(d)

None of given

આપેલમાંથી એકપણ નહિ

Answer:

Option (b)

27.

Which of the following is correct driver to connect mysql database?

Mysql ડેટાબેઝ કનેક્ટ કરવા માટે નો સાચો ડ્રાઈવર કયો છે?

(a)

com.java.mysql.Driver

(b)

sun.jdbc.mysql.Driver

(c)

com.mysql.jdbc.Driver

(d)

None of given

આપેલમાંથી એકપણ નહિ

Answer:

Option (c)

28.

Which method of DriverManager class is used to establishment connection with database?

ડેટાબેઝ સાથે કનેક્શન કરવા માટે ડ્રાઈવર મેનેજર (DriverManager) ક્લાસ ની કઈ મેથડ ઉપયોગી છે?

(a)

Connection()

(b)

SetConnection()

(c)

Both Connection() & SetConnection()

Connection() અને SetConnection() બંને

(d)

getConnection()

Answer:

Option (d)

29.
Which driver is efficient and preferable for JDBC applications?
JDBC એપ્લીકેશન માટે કયો ડ્રાઈવર એફિસીયન્ટ અને પ્રીફ્રેબલ છે?
(a) Type-1
(b) Type-2
(c) Type-3
(d) Type-4
Answer:

Option (d)

30.
State true or False: next() method of ResultSet is used to move to the next row of the ResultSet, making it the current row.
આપેલ વિધાન સાચું છે કે ખોટું: ResultSet ની Next() મેથડ નો ઉપયોગ ResultSet ની આગળ ની રો માં મુવ થવા અને તેને કરન્ટ રો(current row) બનાવવા માટે થાય છે.
(a) true
(b) False
false
Answer:

Option (a)

Showing 21 to 30 out of 33 Questions