Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

B&S: can't open as .jar, accessed as .zip

 
Grary Stimon
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't have the JRE or JDK installed when I downloaded my SCJD B&S assignment. So, I opened the .jar exam file as a .zip. The appearance of the database file has since been vexing to me -- whether viewed in a text or hex editor. So, I'm thinking maybe the assignment must be opened as a .jar.

Mine may prove to be a minor worry, but I'm on guard not to work with any materials that do not match exactly what Sun sent.

Thanks for any comments,

Grary
 
Alex Belisle Turcot
Ranch Hand
Posts: 516
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Grary Stimon:
I didn't have the JRE or JDK installed when I downloaded my SCJD B&S assignment. So, I opened the .jar exam file as a .zip. The appearance of the database file has since been vexing to me -- whether viewed in a text or hex editor. So, I'm thinking maybe the assignment must be opened as a .jar.

Mine may prove to be a minor worry, but I'm on guard not to work with any materials that do not match exactly what Sun sent.

Thanks for any comments,

Grary


In all cases, a jar file is a zip file. To open it and view what's inside, opening it just like a zip file is the only option.

About the database file, can you elaborate on the format ? What is unusual about it ?

If I open mine with notepad, I can see words separated by "square" and other special characters... It is meant to be read as bytes with some minor conversion..

Which filename are you refering to and what does it look like.

Regards,
Alex
[ October 03, 2008: Message edited by: Alex Belisle Turcot ]
 
Mahendran Mohan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Agree with previous rancher. Zip or Jar doesnt matter.

As for your concern on db file: You might have to look at your db schema definition. db file is not supposed to be processed by text editors. You might only see a mix of special and normal characters if you open it. It is supposed to be processed by application as per its schema definition.
 
Mahendran Mohan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Agree with previous rancher. Zip or Jar doesnt matter.

As for your concern on db file: You might have to look at your db schema definition. db file is not supposed to be processed by text editors. You might only see a mix of special and normal characters if you open it. It is supposed to be processed by application as per its schema definition.
 
Jethro Borsje
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The db file is binary, it is not supposed to be opened in a text or hex editor. You should read it using a DataInputStream or RandomAccessFile using your Java program.
 
Grary Stimon
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for all your helpful comments.
 
Daniel Salomons
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To understand the file format read the instructions.html VERY, VERY carefully. One thing that needs some explanation is the 'magic cookie' which is called at the English Wikipedia "magic number". It is a 4 byte integer, that signifies the file type. If on a Unix/Linux system the command: file <dbfile> is invoked, a message stating that it is a data file will appear. To me it seems that you'll make Sun a little bit happier if you check for the right number at the beginning of the file, and give a warning if it is not what is expected.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic