About Question enthuware.ocpjp.v7.2.1365 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
The_Nick
Posts: 132
Joined: Thu May 16, 2013 9:23 am
Contact:

About Question enthuware.ocpjp.v7.2.1365 :

Post by The_Nick »

So basically the WHERE clause is case insensitive an the FROM is case sensitive?
I thought it was case sensitive WHERE that's why I mistook.

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1365 :

Post by admin »

Well, the table name is not important once the query has run (unless you are using the meta data). The question is talks about case insensitivity of the column names because the case is different in the query and the get method.

HTH,
Paul.

ewebxml
Posts: 77
Joined: Sun Jun 30, 2013 10:04 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1365 :

Post by ewebxml »

Code: Select all

 
ResultSet rs = stmt.executeQuery("select * from CUSTOMER where EMAILID='bob@gmail.com'"); //LINE 10        
 while(rs.next()){             
	System.out.println(rs.getString("emailid")); //LINE 12
Question 1: For this question, do we assume that
EMAILID is mapped to ("emailid")?
--------

Question 2: Is EMAILID on line 10
a
1) columnIndex or
2) columnLabel?

-----
The Oracle Docs do not distinguish
http://docs.oracle.com/javase/7/docs/ap ... ltSet.html

between the 2 getString methods.
-----
String getString(int columnIndex)
Retrieves the value of the designated column in the current row of this ResultSet object as a String in the Java programming language.
String getString(String columnLabel)
Retrieves the value of the designated column in the current row of this ResultSet object as a String in the Java programming language.

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1365 :

Post by admin »

I am not sure why you think EMAILID at line 10 could be a columnIndex or label. It is neither. It is the name of a column.
At line /12, since we are passing a String, it is a columnLabel.

-Paul.

Alina_Lapina
Posts: 15
Joined: Tue Jan 13, 2015 12:10 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1365 :

Post by Alina_Lapina »

Should we just ignore that the variable 'connection' isn't initialized in the question?

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1365 :

Post by admin »

Alina_Lapina wrote:Should we just ignore that the variable 'connection' isn't initialized in the question?
Yes, in the exam also you will find questions where initialization of some variables is not shown. You can safely assume that they are initialized appropriately. If the answer depends on this information, then the question will show it.

toolforger
Posts: 38
Joined: Fri Nov 13, 2015 4:40 am
Contact:

Re: About Question enthuware.ocpjp.v7.2.1365 :

Post by toolforger »

Where is the spec that says that column names are case insensitive?
Reviewing the pertinent information in the ResultSet JavaDoc says "the name of the column", with no specific information about case sensitivity.
This seems to be a database property; some databases have case-insensitive column names, some have case-sensitive names, for some databases that's even a setting (I think that is the case with MySQL).
What does the Oracle test assume here? Do they have questions that depend on case sensitivity? If yes, do they state sensitivity, do they assume sensitive, do they assume insensitive?

Update: I see it's buried in the ResultSet javadoc, but not on the individual getters.
Nasty.

Post Reply

Who is online

Users browsing this forum: Google [Bot], Shiftingsandsxlc and 8 guests