About Question enthuware.ocpjp.v7.2.1365 :
Moderator: admin
-
- Posts: 132
- Joined: Thu May 16, 2013 9:23 am
- Contact:
About Question enthuware.ocpjp.v7.2.1365 :
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.
I thought it was case sensitive WHERE that's why I mistook.
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1365 :
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.
HTH,
Paul.
-
- Posts: 77
- Joined: Sun Jun 30, 2013 10:04 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1365 :
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
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.
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1365 :
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.
At line /12, since we are passing a String, it is a columnLabel.
-Paul.
-
- Posts: 15
- Joined: Tue Jan 13, 2015 12:10 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1365 :
Should we just ignore that the variable 'connection' isn't initialized in the question?
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1365 :
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.Alina_Lapina wrote:Should we just ignore that the variable 'connection' isn't initialized in the question?
-
- Posts: 38
- Joined: Fri Nov 13, 2015 4:40 am
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1365 :
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.
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.
Who is online
Users browsing this forum: No registered users and 8 guests