File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes strange behaviour of Class Data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "strange behaviour of Class Data" Watch "strange behaviour of Class Data" New topic

strange behaviour of Class Data

Martin Habicht

Joined: Nov 07, 2001
Posts: 17
just started to dig into the provided SCJD code and wanted to run a little test program, to display the content of the database. I was surprised to see, that only some records were displayed and only half the fields. However if I put my (single threaded) application asleep, i get all records. (but still only the first 4 fields).
Well, I just wanted to ask whether others experienced the same strange behaviour or whether this is even part of the problem to solve.
thanks for your comment - the full source of my test program is below.


package suncertify.db;
public class DbTest {
private static String dbname = "F:/j2se/jdk131/src/suncertify/db/db.db"; //please change to your path!
public static void main(String[] argv) {
try {
Data data = new Data(dbname);
int count = data.getRecordCount();
System.out.println("Database contains the follwing # of records: " + count + "\n");
DataInfo rec = null;
for (int i = 1; i<= count; i++)
rec = data.getRecord(i);
//Thread.sleep(50); // if the threads sleeps all records will appear?!?


} catch (Exception e) {
Bal Sharma
Ranch Hand

Joined: Sep 19, 2001
Posts: 273
Hey Martin:
Try following link. Is not that what you wanted? Is it?
See: [URL= [/URL] Here
Good Luck. BK

[This message has been edited by Bal Sharma (edited November 07, 2001).]
Martin Habicht

Joined: Nov 07, 2001
Posts: 17
thanks for the reply. concerning the code snipplet you're right - i haven't read the faq throughly.

But after your input I solved the real problem, which was caused by KAWA that didn't display all lines (scrolling was not an issue - some records were completely missing!). running directly from a dos box works fine. sometimes the solution is so simple...

I agree. Here's the link:
subject: strange behaviour of Class Data
It's not a secret anymore!