• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RandomAccessFile for read/write database file?

 
Pavlo Rybakov
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody,

I have just a short question...
May I use instead of
final InputStream database = new FileInputStream(DATABASE_LOCATION);




?

Cheers,

PR.
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Was the file in fact created to be a random access file from the get-go? You may wish to give more detail on just what is going on here.

Please understand that database file often has special connotation here -- that being a file created and maintained by a database such as MySQL, and that your stating this initially confused me (sorry, but I'm easily confused!) and perhaps others as well.

Much luck!
 
Pavlo Rybakov
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, guys, my question was can I use in SCJD RandomAccessFile or MUST I use FileInputStream/FileOutputStream

I found answer in old topics ( "yes, i can" ).

Thanks.

topic CBD.
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course you can use a RandomAccessFile for your SCJD assignment. I think almost 99% of the certification participants used it
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pavlo Rybakov wrote:Sorry, guys, my question was can I use in SCJD RandomAccessFile or MUST I use FileInputStream/FileOutputStream
I found answer in old topics ( "yes, i can" ).


No need to apologize as I think it is my confusion here, not yours. Luck!
 
Carlos Morillo
Ranch Hand
Posts: 221
Java Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pavlo,

Yes, I did use a RandomAccessFile in my assignment.

Best Regards,

Carlos.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic