• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Assignment on it's way.....

 
Ranch Hand
Posts: 267
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all
I havent posted in a while just wanted to say i am fine and well!I just completed payment for the SCJD assignment and i am expecting the mail from SUN concerning the assignment! This post is to ask all of you guys about my readiness, i got Max's book in January and i have read it cover to cover about 4 times(ok well not maybe entirely, the chapter on NIO seems so complicated), i have downloaded the sample app and studied it so much that i have implemented a similar project using JDBC and a JTable and used his design pattern entirely! I left out RMI and threading for my sample project, but i was able to fully comprehend the Locking and RMI stuff effectively well. My question is "am i kinda prepared for the exam having read Max's book?" I know it's silly to ask that but after reading Max's book i feel kinda confident though! All i have to do is fully understand the business requirements and the damn Database format that comes with it! I still have some bit of trouble understanding it from postings from fellow SCJD buddies, but i wanna go thru the RandomAccessFile API and then i guess i would be able to tackle the database schema! Whatever happens i will be in touch via postings when i get confused! Pls guys i would need a bit of support! Thanks alot and this is a wonderful family!Luv yah all
 
Ranch Hand
Posts: 808
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't worry about the database format. It's a _very_ simple flat file with some schema info at the start of the file, before the data records.
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't worry about the db format, it took me 1 hour to understand it. However, be aware of the locking stuff, I've been stuck there for 3 days now...
[ July 12, 2005: Message edited by: Alex Matute ]
 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys, the tricky thing about reading the database is that its using the ReadUTF() method for the names of the fields.

Reads in a string that has been encoded using a modified UTF-8 format. The general contract of readUTF is that it reads a representation of a Unicode character string encoded in Java modified UTF-8 format; this string of characters is then returned as a String.
 
Alex Matute
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thomas, are you completely sure? Because I read the spec and I don't think I can use the readUTF() method of RandomAccessFile. My instructions say:


Repeated for each field in a record:
1 byte numeric, length in bytes of field name
n bytes (defined by previous entry), field name

and according to Sun's JAVA API:

The first two bytes are read, starting from the current file pointer, as if by readUnsignedShort. This value gives the number of following bytes that are in the encoded string, not the length of the resulting string. The following bytes are then interpreted as bytes encoding characters in the UTF-8 format and are converted into characters.



I don't think the UTF format has anything to do with this specific project, please correct me if I'm wrong.
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Thomas (and everyone else),

Hi guys, the tricky thing about reading the database is that its using the ReadUTF() method for the names of the fields.

Please remember that there are different assignments out there - a few work well with readUTF, and some cannot use it at all.

Regards, Andrew
 
reply
    Bookmark Topic Watch Topic
  • New Topic