Servlets/Servlets MCQ QUESTIONS AND ANSWER Sample Test,Sample questions

Question:
	
Which JDBC product components does the Java software provide?

1.The JDBC driver manager

2.The JDBC driver test suite

3. The JDBC-ODBC bridge

4.All mentioned above


Question:
	
Which of the following is correct about JDBC?

1.JDBC architecture decouples an abstraction from its implementation.

2. JDBC follows a bridge design pattern

3. Both of the above

4.None of the above.


Question:
	
Which of the following step establishes a connection with a database?

1. Import packages containing the JDBC classes needed for database programming.

2. Register the JDBC driver, so that you can open a communications channel with the database.

3.Open a connection using the DriverManager.getConnection () method

4.Execute a query using an object of type Statement.


Question:
A leading database connectivity vendor, worked together to produce the ____.

1.JDBC-ODBC Bridge

2.JDBC Driver Test Suite

3.Both A & B

4.None of the above


Question:
How many Result sets available with the JDBC 2.0 core API?

1.2

2. 3

3. 4

4.5


Question:
In the following JDBC drivers which is known as fully java driver?

1.Native-API driver

2.Network Protocol driver

3.Thin driver

4.Both B & C


Question:
In the following URL, identify the protocol identifier? https://mcqmate.com:8080/course.php

1.http

2.gtu.ac.in

3.//mcqmate.com:80/course.php

4.8080


Question:
In the socket programming, for an IP address, which can be used to find the host name and IP address of a client/ server?

1.The ServerSocket class

2.The Socket class

3.The InetAddress class

4.The Connection interface


Question:
JDBC is a Java API that is used to connect and execute query to the database

1.True

2.False

3.none

4.all


Question:
The client requests a connection to a server using which of the following statement?

1.Socket s = new Socket(ServerName, port);

2.Socket s = serverSocket.accept();

3.Socket s = serverSocket.getSocket()

4.Socket s = new Socket(ServerName);


Question:
The JDBC API is what allows access to a data source from a Java middle tier

1.True

2.False

3.none

4.all


Question:
To connect to a server running on the same machine with the client, which of the following cannotbe used for the hostname?

1.localhost

2."127.0.0.1"

3.InetAddress.getLocalHost(),

4.127.0.0.0


Question:
To create an InputStream on a socket, say s, which of the following statement is necessary?

1.InputStream in = new InputStream(s);

2.InputStream in = s.getInputStream();

3.InputStream in = s.obtainInputStream();

4.InputStream in = s.getStream();


Question:
To create an InputStream on a socket, say s, which of the following statement is necessary?

1.InputStream in = new InputStream(s);

2.InputStream in = s.getInputStream();

3.InputStream in = s.obtainInputStream();

4.InputStream in = s.getStream();


Question:
What is the reason that a java program cannot directly communicate with an ODBC driver?

1.ODBC written in C# language

2.ODBC written in C language

3.ODBC written in C++ language

4.None of the above


Question:
Which class has traditionally been the backbone of the JDBC architecture?

1.the JDBC driver manager

2.the JDBC driver test suite

3.the JDBC-ODBC bridge

4.All mentioned above


Question:
Which class has traditionally been the backbone of the JDBC architecture?

1.the JDBC driver manager

2.the JDBC driver test suite

3.the JDBC-ODBC bridge

4.All mentioned above


Question:
Which driver converts JDBC calls directly into the vendor-specific database protocol?

1.Native - API driver

2.Network Protocol driver

3.Thin driver

4.Both B & C


Question:
Which driver uses ODBC driver to connect to the database?

1.JDBC-ODBC bridge driver

2.Native - API driver

3.Network Protocol driver

4.Thin driver


Question:
Which JDBC drivers will run your program?

1.The JDBC-ODBC bridge

2.The JDBC driver manager

3.The JDBC driver test suite

4.None of the above


Question:
Which models do the JDBC API support for the database access?

1.Two-tier models

2.Three-tier models

3.Both A & B

4.None of the above


Question:
Which of the following holds data retrieved from a database after you execute an SQL query using Statement objects?

1.ResultSet

2.JDBC driver

3.Connection

4.Statement


Question:
Which of the following is not a valid type of ResultSet?

1.ResultSet.TYPE_FORWARD_ONLY

2.ResultSet.TYPE_SCROLL_INSENSITIVE

3.ResultSet.TYPE_SCROLL_SENSITIVE

4.ResultSet.TYPE_BACKWARD_ONLY


Question:
Which of the following is true about JDBC?

1. The JDBC API is an API to access different relational databases.

2.You use it to access relational databases without embedding a dependency on a specific database type in your code.

3.JDBC stands for Java DataBase Connectivity.

4.All of the above.


Question:
Which of the following manages a list of database drivers in JDBC?

1.DriverManager

2.JDBC driver

3.Connection

4.Statement


Question:
Which of the following protocols is/are for splitting and sending packets to an address across a network?

1.TCP/IP

2.FTP

3.SMTP

4.UDP


Question:
Which of the following type of JDBC driver should be used if your Java application is accessing multiple types of databases at the same time?

1.Type 1

2.Type 2

3.Type 3

4.Type 4


Question:
Which of the following type of JDBC driver, is also called Type 1 JDBC driver?

1.JDBC-ODBC Bridge plus ODBC driver

2.Native-API, partly Java driver

3.JDBC-Net, pure Java driver

4.Native-protocol, pure Java driver


Question:
Which of these class is used to encapsulate IP address and DNS?

1.DatagramPacket

2.URL

3.InetAddress

4.ContentHandler


Question:
Which of these package contains classes and interfaces for networking?

1.java.io

2.Java.util

3.java.net

4.javax.swing


Question:
Which was the first most widely used programming interface for accessing relational databases and it offers the ability to connect all the databases on all the platforms.?

1.JDBC API

2.ODBC API

3.Both A & B

4.None of the above


More MCQS

  1. Servlets - Java (MCQ) questions
  2. Servlets MCQ QUESTIONS AND ANSWER
  3. Servlets Advanced JAVA MCQ QUESTIONS AND ANSWER
Search
Olete Team
Online Exam TestTop Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on Online Exam Testwebsite is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!