EXPERTY DESIGNED 1Z0-809 PRACTICE TEST

Oracle 1Z0-809 Exam Questions
Total Questions: 469
Java SE 8 Programmer II
Updated On: Oct 04, 2025
Page : 1-47
Question 1

Which of the following code will create/return a Locale object for the JVM, on which your code is running?


Options :
Answer: B

Question 2

Assume that proper import statements are available, and 'fr' is the language code for French language. 

And you have the following code snippet:

Locale [] loc = Locale.getAvailableLocales(); 

Which of the following statements will print all the supported (by the JVM) French Language Locale on to the console?

Select 2 options.

Options :
Answer: C,D

Question 3

Given the code fragments:

Untitled1-page69-image83
and
Untitled1-page69-image88
What is the result?

Options :
Answer: D

Question 4

Given the code fragment:

9. Connection conn = DriveManager.getConnection(dbURL, userName, passWord);
10. String query = “SELECT id FROM Employee”;
11. try (Statement stmt = conn.createStatement()) {
12. ResultSet rs = stmt.executeQuery(query);
13. stmt.executeQuery(“SELECT id FROM Customer”);
14. while (rs.next()) {
15. //process the results
16. System.out.println(“Employee ID: “+ rs.getInt(“id”));
17. }
18. } catch (Exception e) {
19. System.out.println (“Error”);
20. }
Assume that:
 The required database driver is configured in the classpath.
 The appropriate database is accessible with the dbURL, userName, and passWord exists.
 The Employee and Customer tables are available and each table has id column with a few records and
the SQL queries are valid.
What is the result of compiling and executing this code fragment?

Options :
Answer: C

Question 5

Given structure of EMPLOYEE table: 

EMPLOYEE (ID integer, FIRSTNAME varchar(100), LASTNAME varchar(100), SALARY real, PRIMARY KEY (ID)) 

EMPLOYEE table contains below records: 

1. 101 John Smith 12000

2. 102 Sean Smith 15000

3. 103 Regina Williams 15500

4. 104 Natasha George 14600

Given code of Test.java file: 

1. package com.udayan.ocp;

2.  

3. import java.sql.*;

4. import java.util.Properties;

5.  

6. public class Test {

7.     public static void main(String[] args) throws Exception {

8.         String url = "jdbc:mysql://localhost:3306/ocp";

9.         Properties prop = new Properties();

10.         prop.put("user", "root");

11.         prop.put("password", "password");

12.         String query = "Select ID, FIRSTNAME, LASTNAME, SALARY FROM EMPLOYEE ORDER BY ID";

13.         try (Connection con = DriverManager.getConnection(url, prop);

14.              Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);

15.              ResultSet rs = stmt.executeQuery(query);)

16.         {

17.             rs.afterLast();

18.             rs.relative(-1);

19.             rs.previous();

20.             System.out.println(rs.getInt(1));

21.         }

22.     }

23. }

Also assume: 

URL, username and password are correct.

SQL query is correct and valid.

The JDBC 4.2 driver jar is configured in the classpath.

What will be the result of compiling and executing Test class? 

Options :
Answer: A

© Copyrights Oracledumps 2025. All Rights Reserved

We use cookies to ensure that we give you the best experience on our website (Oracledumps). If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the Oracledumps.