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

Problems geting the data from Data class

 
Ricardo Polero
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, folks
I tried many time to get data from Data class but always got the DataBaseException
My code :
.....
DataInfo result;
Data datalocal = null;
result = null;
...
datalocal = new Data("db/db.db"); // OK no exceptions !
...
try {
result=datalocal.getRecord(1); // DATABASE EXCEPTION ???
System.out.println("result " + result.toString());
} catch (DatabaseException e) {
System.out.println("DatabaseException with DB");}
Would someone PLS give me some direction / example ?
Thanks in advance
Ricardo
 
Andras Nemeth
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hella Ricardo,
Originally posted by Ricardo Polero:
Hi, folks
I tried many time to get data from Data class but always got the DataBaseException
My code :
.....
DataInfo result;
Data datalocal = null;
result = null;
...
datalocal = new Data("db/db.db"); // OK no exceptions !

How can it be OK without try catch block?
Are you sure that the path is OK??? I recommend
./suncerify/db/db.db if you are in the directory where
you expanded/unjared the java2.jar file...

...
try {
result=datalocal.getRecord(1); // DATABASE EXCEPTION ???
Ricardo[/B]

I think it would help if you paste the exception also.
Ban
 
Ricardo Polero
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI, Thx for the replay !
for my tree structure
datalocal = new Data("db/db.db");
works fine for now because:
System.out.println(datalocal.getRecordCount()); prints 24.
But, when I called datalocal.find("PA001") or
datalocal.getRecord(1)
I got the exception DatabaseException :

try {
System.out.println("before");
datalocal.getRecord(1) ;
} catch (DatabaseException e) {
System.out.println("DatabaseException DB");
}
PLZ HELP !
 
Andras Nemeth
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
As I wrote, it would help a lot if you paste here what
is the DatabaseException...
Change the exception handling to
System.out.println("DatabaseException: \n"+e);
Bye,
Ban
 
Ricardo Polero
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Thx a lot I fixed. Was my mistake to choose a wrong String constructor for the depreccated constructor
Ricardo
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic