Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX : Database Access

 
Shekar Atmakur
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I recently downloaded the and have a question.
In order to access the given database do i need to use jdbc or I/O streams?
This is what i think, please clarify my thoughts.
The .db file is a relational database and java cannot access this file using the JDBCODBC bridge driver unless and third party utility is used, which ofcource is not permitted. So the only other way to access this data is by the use of java I/O streams.
I may be way of mark, but please clarify.
thanx,
shekar
 
Michael Fitzmaurice
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Shekar
The data file is a flat file, in plain old ASCII text, so you can use basic Java IO to read from and write to it. No JDBC needed.
Michael
 
Shekar Atmakur
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Michael Fitzmaurice:
Hi Shekar
The data file is a flat file, in plain old ASCII text, so you can use basic Java IO to read from and write to it. No JDBC needed.
Michael

Micheal,
Thanks for the quick reply.Just to be more clear When you say you "Can use basic java IO", do you meant it is more convinient to do so or is there JDBC api(or any other way for that matter) that can also be used?
thanks,
shekar
 
Michael Fitzmaurice
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I mean do not consider using JDBC. JDBC has nothing to do with this assignment, really. Use standard Java IO, as found in the java.io & java.nio packages.
If you were to use JDBC to access a flat file - well, you could find a way to do this I suppose, but I haven't heard of anyone else doing so for the SCJD. You would essentially be writing a JDBC driver for your own proprietary database if you took this approach, which would be overcomplicating things massively, IMO. The instructions certainly do not require you to make your database JDBC compliant, so why bother?
Stick to simple IO. What you are doing at the lowest level of data access is disk IO, and this would be the case even if you made your database JDBC compatible. So you can't avoid doing the IO anyway.
Have you actually downloaded the instructions for this assignment? If so, which part made you think about using JDBC?
 
Shekar Atmakur
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Micheal,
Thanks a lot. I'm clear now. I surely do not want to complicate my problems.
Yes i have downloaded my Assignement.It is the URLYBird one. It does not specify the need to use JDBC. It is just that whenever i think Database, i automatically think JDBC.
Thanks a lot, i appreciate your response.
Shekar
 
Philippe Maquet
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Shekar,
Welcome to this forum.
I just agree with all what Michael wrote above. I will just add that the few classes which are interesting to investigate before starting are : RandomAccessFile, FileChannel and Charset.
Now just using those class names as keywords for a search on this forum should bring to you a lot of (hopefully useful) information.
Best,
Phil.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic