Solved

Accessing a BTree File System using Java

Posted on 2012-04-12
6
885 Views
Last Modified: 2013-11-13
We use an RTISAM database structure, basically a BTree file system.  We access it now using Unix and Fortran, but I'm curious to know if the data can be accessed using Java and if anyone has any idea on where to get information to do this?  I'm not too familiar with how the database keys work, but would love to learn more about that.
0
Comment
Question by:cscpaymaster
  • 3
  • 2
6 Comments
 
LVL 5

Expert Comment

by:dcesari
ID: 37841253
Can you please give more details on how you access this database from Fortran? Do you use language extensions of some proprietary compiler or standard Fortran statements (for filesystem access?!?!), or some API (external library)?
0
 

Author Comment

by:cscpaymaster
ID: 37842295
Using Procomm Plus command line editor in Unix and standard FORTRAN 77 and 90 commands.  Files are in a directory (two files - one .rec and one .ind) that are accessed remotely.  Calls are made to open and close files on logical file units.  Records are accessed via keys (I assume these are in the index file) and once the right key is located, the associated record's information can be accessed by loading the data into an array.  The data is actually segmented into 'words' and/or bits.  I'm fairly new at this, so I hope this is the info you were looking for.  Because these are files that I can't actually open and look at, I may not be explaining it well.
0
 
LVL 5

Expert Comment

by:dcesari
ID: 37842635
From your information I guess these .rec and .ind are Fortran unformatted files, probably .rec is of direct-access type. Anyway there is no(t much) magic in unformatted Fortran files, you simply have to look at the Fortran code and emulate that I/O in java using some kind of binary I/O functions. This is a translate/rewrite-of-code exercise, which reasonably has to be done by hand.

If you attach some examples of OPEN/READ/WRITE Fortran statements used I can say something more.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:cscpaymaster
ID: 37842922
Open a file, array 'DATA' is set to 48 size:
8     CALL OPNEMP(5,'FILENAME',6,ICODE)
      KEY(1)=0
      KEY(2)=0
      KEY(3)=' 1'
      CALL GET$$(5,DATA,KEY,0,ICODE)
      IF (ICODE.NE.0) CALL STOP$('08',2)
...then I can use DATA(1) thru DATA(48) as variable values.  For example, DATA(19) is formated as 15A2, which is 30 alpha characters containing a customer name.  So in my code, I can type CALL MOVE$(DATA(19),CONAME,15)), effectively assigning the value of DATA(19) to the variable CONAME and then use CONAME as I wish to print it to the screen, store it in another array, etc.

The record that I am retreiving is based on the value in KEY, which is an array of length 3 - in this case, the value in KEY(3) of ' 1' brings me to a specific record.

Does this help explain?
0
 
LVL 24

Accepted Solution

by:
Tomas Helgi Johannsson earned 500 total points
ID: 37849287
Hi!

http://www.javaforge.com/wiki/66061

Is this something you could use ?

Regards,
     Tomas Helgi
0
 

Author Comment

by:cscpaymaster
ID: 37849294
Yes, Tomas, thank you.  This is very helpful.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now