Deck 1: Networking and JDBC
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/25
Play
Full screen (f)
Deck 1: Networking and JDBC
1
Which of these package contains classes and interfaces for networking?
A)java.io
B)java.util
C)java.net
D)javax.swing
A)java.io
B)java.util
C)java.net
D)javax.swing
java.net
2
In the following URL, identify the protocol identifier? https://gtu.ac.in:8080/course.php
A)http
B)gtu.ac.in
C)//gtu.ac.in:80/course.php
D)8080
A)http
B)gtu.ac.in
C)//gtu.ac.in:80/course.php
D)8080
http
3
Which of the following protocol follows connection less service?
A)TCP
B)TCP/IP
C)UDP
D)HTTP
A)TCP
B)TCP/IP
C)UDP
D)HTTP
UDP
4
Which of the following statement is NOT true?
A)TCP is a reliable but slow.
B)UDP is not reliable but fast.
C)File Transfer Protocol (FTP) is a standard Internet protocol for transmitting files between computers on the Internet over TCP/IP connections.
D)In HTTP, all communication between two computers are encrypted
A)TCP is a reliable but slow.
B)UDP is not reliable but fast.
C)File Transfer Protocol (FTP) is a standard Internet protocol for transmitting files between computers on the Internet over TCP/IP connections.
D)In HTTP, all communication between two computers are encrypted
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
5
Which of the following statement is TRUE?
A)With stream sockets there is no need to establish any connection and data flows between the processes are as continuous streams.
B)Stream sockets are said to provide a connection-less service and UDP protocol is used
C)Datagram sockets are said to provide a connection-oriented service and TCP protocol is used
D)With datagram sockets there is no need to establish any connection and data flows between the processes are as packets.
A)With stream sockets there is no need to establish any connection and data flows between the processes are as continuous streams.
B)Stream sockets are said to provide a connection-less service and UDP protocol is used
C)Datagram sockets are said to provide a connection-oriented service and TCP protocol is used
D)With datagram sockets there is no need to establish any connection and data flows between the processes are as packets.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
6
Which of the following method call is valid to obtain the server's hostname by invoking an applet?
A)getCodeBase().host()
B)getCodeBase().getHost()
C)getCodeBase().hostName()
D)getCodeBase().getHostName()
A)getCodeBase().host()
B)getCodeBase().getHost()
C)getCodeBase().hostName()
D)getCodeBase().getHostName()
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
7
The server listens for a connection request from a client using which of the following statement?
A)Socket s = new Socket(ServerName, port);
B)Socket s = serverSocket.accept()
C)Socket s = serverSocket.getSocket()
D)Socket s = new Socket(ServerName);
A)Socket s = new Socket(ServerName, port);
B)Socket s = serverSocket.accept()
C)Socket s = serverSocket.getSocket()
D)Socket s = new Socket(ServerName);
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
8
The client requests a connection to a server using which of the following statement?
A)Socket s = new Socket(ServerName, port);
B)Socket s = serverSocket.accept();
C)Socket s = serverSocket.getSocket();
D)Socket s = new Socket(ServerName);
A)Socket s = new Socket(ServerName, port);
B)Socket s = serverSocket.accept();
C)Socket s = serverSocket.getSocket();
D)Socket s = new Socket(ServerName);
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
9
To connect to a server running on the same machine with the client, which of the following cannotbe used for the hostname?
A)"localhost"
B)"127.0.0.1"
C)InetAddress.getLocalHost(),
D)"127.0.0.0"
A)"localhost"
B)"127.0.0.1"
C)InetAddress.getLocalHost(),
D)"127.0.0.0"
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
10
In the socket programming, for an IP address, which can be used to find the host name and IP address of a client/ server?
A)The ServerSocket class
B)The Socket class
C)The InetAddress class
D)The Connection interface
A)The ServerSocket class
B)The Socket class
C)The InetAddress class
D)The Connection interface
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
11
To create an InputStream on a socket, say s, which of the following statement is necessary?
A)InputStream in = new InputStream(s);
B)InputStream in = s.getInputStream();
C)InputStream in = s.obtainInputStream();
D)InputStream in = s.getStream();
A)InputStream in = new InputStream(s);
B)InputStream in = s.getInputStream();
C)InputStream in = s.obtainInputStream();
D)InputStream in = s.getStream();
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
12
Which of the following protocols is/are for splitting and sending packets to an address across a network?
A)TCP/IP
B)FTP
C)SMTP
D)UDP
A)TCP/IP
B)FTP
C)SMTP
D)UDP
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
13
Which of these is a protocol for breaking and sending packets to an address across a network?
A)TCP/IP
B)DNS
C)Socket
D)Proxy Server
A)TCP/IP
B)DNS
C)Socket
D)Proxy Server
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
14
Which of these class is used to encapsulate IP address and DNS?
A)DatagramPacket
B)URL
C)InetAddress
D)ContentHandler
A)DatagramPacket
B)URL
C)InetAddress
D)ContentHandler
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
15
Which of the following type of JDBC driver, is also called Type 2 JDBC driver?
A)JDBC-ODBC Bridge plus ODBC driver
B)Native-API, partly Java driver
C)JDBC-Net, pure Java driver
D)Native-protocol, pure Java driver
A)JDBC-ODBC Bridge plus ODBC driver
B)Native-API, partly Java driver
C)JDBC-Net, pure Java driver
D)Native-protocol, pure Java driver
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
16
Which of the following type of JDBC driver, is also called Type 1 JDBC driver?
A)JDBC-ODBC Bridge plus ODBC driver
B)Native-API, partly Java driver
C)JDBC-Net, pure Java driver
D)Native-protocol, pure Java driver
A)JDBC-ODBC Bridge plus ODBC driver
B)Native-API, partly Java driver
C)JDBC-Net, pure Java driver
D)Native-protocol, pure Java driver
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
17
Which of the following holds data retrieved from a database after you execute an SQL query using Statement objects?
A)ResultSet
B)JDBC driver
C)Connection
D)Statement
A)ResultSet
B)JDBC driver
C)Connection
D)Statement
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
18
Which of the following is not a valid type of ResultSet?
A)ResultSet.TYPE_FORWARD_ONLY
B)ResultSet.TYPE_SCROLL_INSENSITIVE
C)ResultSet.TYPE_SCROLL_SENSITIVE
D)ResultSet.TYPE_BACKWARD_ONLY
A)ResultSet.TYPE_FORWARD_ONLY
B)ResultSet.TYPE_SCROLL_INSENSITIVE
C)ResultSet.TYPE_SCROLL_SENSITIVE
D)ResultSet.TYPE_BACKWARD_ONLY
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
19
Which of the following type of JDBC driver, uses database native protocol?
A)JDBC-ODBC Bridge plus ODBC driver
B)Native-API, partly Java driver
C)JDBC-Net, pure Java driver
D)Native-protocol, pure Java driver
A)JDBC-ODBC Bridge plus ODBC driver
B)Native-API, partly Java driver
C)JDBC-Net, pure Java driver
D)Native-protocol, pure Java driver
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
20
What is JDBC?
A)JDBC is a java based protocol.
B)JDBC is a standard Java API for database-independent connectivity between the Java programming language and a wide range of databases.
C)JDBC is a specification to tell how to connect to a database.
D)Joint Driver for Basic Connection
A)JDBC is a java based protocol.
B)JDBC is a standard Java API for database-independent connectivity between the Java programming language and a wide range of databases.
C)JDBC is a specification to tell how to connect to a database.
D)Joint Driver for Basic Connection
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
21
Which of the following manages a list of database drivers in JDBC?
A)DriverManager
B)JDBC driver
C)Connection
D)Statement
A)DriverManager
B)JDBC driver
C)Connection
D)Statement
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
22
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?
A)Type 1
B)Type 2
C)Type 3
D)Type 4
A)Type 1
B)Type 2
C)Type 3
D)Type 4
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
23
Which of the following is correct about JDBC?
A)JDBC architecture decouples an abstraction from its implementation.
B)JDBC follows a bridge design pattern.
C)Both of the above.
D)None of the above.
A)JDBC architecture decouples an abstraction from its implementation.
B)JDBC follows a bridge design pattern.
C)Both of the above.
D)None of the above.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
24
Which of the following step establishes a connection with a database?
A)Import packages containing the JDBC classes needed for database programming.
B)Register the JDBC driver, so that you can open a communications channel with the database.
C)Open a connection using the DriverManager.getConnection () method.
D)Execute a query using an object of type Statement.
A)Import packages containing the JDBC classes needed for database programming.
B)Register the JDBC driver, so that you can open a communications channel with the database.
C)Open a connection using the DriverManager.getConnection () method.
D)Execute a query using an object of type Statement.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
25
Which of the following is true about JDBC?
A)The JDBC API is an API to access different relational databases.
B)You use it to access relational databases without embedding a dependency on a specific database type in your code.
C)JDBC stands for Java DataBase Connectivity.
D)All of the above.
A)The JDBC API is an API to access different relational databases.
B)You use it to access relational databases without embedding a dependency on a specific database type in your code.
C)JDBC stands for Java DataBase Connectivity.
D)All of the above.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck