Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Ambiguous questions in chapter 10 (JDBC) OCP (Sybex)  RSS feed

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
2. Which are required parts of a JDBC URL? (Choose all that apply.)
A. Connection parameters
B. Database name
C. jdbc
D. Location of database
E. Port
F. Password

In the book only B and C are correct.
But if I want to create a Database using mySQL I need the location not the database name. What should I expect for the exam?.

16. Suppose that you have a table with three rows. The names in those rows are Anna, Betty,
and Cat. What does the following output?

A. Anna
B. Betty
C. Cat
D. The code does not compile.
E. A SQLException is thrown.

Actually using mySQL this runs fine, even with a explicit TYPE_FORWARD_ONLY, seems logical because the implementation depends on the vendor.
Using DERBY fails in the same way as the book.

18.
Suppose that you have a table animal with three rows. The names in those rows are Anna,
Betty, and Cat. What does the following output?

A. Anna
B. Betty
C. Cat
D. The code does not compile.
E. A SQLException is thrown.

This one is in the errata page already, but it will return Anna using mySQL, but a runtime exception with DERBY.
 
Emanuel Frua
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The title is wrong I meant S&B. Selikoff-Boyarsky.
 
author & internet detective
Posts: 38906
684
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Emanuel,
Thanks for asking. This topic is hard because there's theory and reality. The book (and exam) delve too far on the theory side IMHO.

MySql is an implementation as is postgres and Oracle and... Each implementation is different. Derby is an implementation too, but comes with Java so is "more official." Just pretend the MySql location is the name and it will be easier to remember. Honestly, the whole topic is annoying because in the real world, one uses a DataSource and doesn't encounter these connection strings so often!
 
Emanuel Frua
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeanne, thanks to you for your prompt answer. Yes, I didn't say they were errors, but I didn't know what to think for the exam. You just cleared my doubts.
 
Jeanne Boyarsky
author & internet detective
Posts: 38906
684
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Emanuel Frua wrote:Yes, I didn't say they were errors, but I didn't know what to think for the exam. You just cleared my doubts.


Right. My frustration leaks out on the topic. And you probably noticed in the book where we talk about PreparedStatements and DataSources!
 
Emanuel Frua
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, the introduction scared me a little! Although it wasn't the hardest chapter.
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, my frustration is ... not personally meant ...

If you ask a question, what are required parts of a JDBC URL?

In the book is not meant, what is required and not, at least not very clear ...


 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!