nerdexam
Oracle

1Z0-909 · Question #64

A server hosts MySQL Server and Apache Webserver supporting a PHP/PDO based application. The application must be migrated from PHP to their Java application server on another host. The MySQL…

The correct answer is B. The socket is not implemented in Connector/J driver. E. Java treats the socket file as insecure. Two Java-specific barriers block use of the Unix socket. B is correct because MySQL Connector/J - the standard JDBC driver - communicates exclusively over TCP/IP and has no implementation for Unix domain socket connections, unlike PHP's PDO which supports them natively. E is…

Application Development

Question

A server hosts MySQL Server and Apache Webserver supporting a PHP/PDO based application. The application must be migrated from PHP to their Java application server on another host. The MySQL instance remains on the original host. Examine the PDO connection string used in the existing application:

Mysql:host-localhost;dbname=sales;unix_socket=/var/run/mysql.sock Which two prevent Java from using the Unix socket?

Options

  • AThe X Dev API protocol must be enabled to use sockets in Connector/J driver.
  • BThe socket is not implemented in Connector/J driver.
  • CThe socket can only be accessed from the local host.
  • Dsocket is a reserved word in Java.
  • EJava treats the socket file as insecure.

How the community answered

(30 responses)
  • A
    10% (3)
  • B
    63% (19)
  • C
    7% (2)
  • D
    20% (6)

Explanation

Two Java-specific barriers block use of the Unix socket. B is correct because MySQL Connector/J - the standard JDBC driver - communicates exclusively over TCP/IP and has no implementation for Unix domain socket connections, unlike PHP's PDO which supports them natively. E is correct because Java's security model treats Unix socket files (filesystem-based IPC) as outside its permitted I/O abstractions; access to such files is restricted by Java's security architecture and, historically, Java lacked Unix domain socket support entirely until JEP 380 in Java 16, making the socket inaccessible in standard Connector/J configurations.

Distractors: A is wrong - the X Dev API (MySQL Shell protocol) is unrelated to socket file support in Connector/J. C sounds plausible (Unix sockets are local-only), but it's a general Unix networking fact, not a Java-specific reason - the question asks what prevents Java from using it. D is wrong - socket is not a reserved keyword in Java; java.net.Socket is a class, not a reserved word.

Memory tip: Think "Blocked driver, Exiled by security" - Connector/J never built it in (B), and Java's security model walls it off (E). C tempts you because it's true about Unix sockets generally, but the question targets Java-specific obstacles.

Topics

#MySQL Connector/J#Unix Socket#Java Database Connectivity#Driver Implementation

Community Discussion

No community discussion yet for this question.

Full 1Z0-909 Practice