Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

unclosed string in db.db ?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone,
When I try this piece of code on the file db.db
I got a system exit because the array of string is not
correctly formatted.
it looks like that:
"SA003" "SFO" "LAX" "SpeedyAir "100 "tue" "10:50" "22m " 37
because the string are not close i got a problem ?
any clues ?
here's the code i'm using:
import suncertify.db.*;
import java.io.*;
public class First{
public static void main(String args[]){
try{
Data d = new Data("../db.db");
DataInfo di = d.getRecord(3);
String[] values = di.getValues();

for (int j=0;j<values.length;j++)>
System.out.println(" values "+j+" = "+values[j]);
}catch(Exception e){}
}
}
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I believe that your code has little problem.
The following code

for (int j=0;j System.out.println(" values "+j+" = "+values[j]);
}catch(Exception e){}

should probably be:
for (int j=0; j less than values.length; j++) {
System.out.println(" values "+j+" = "+values[j]);
}catch(Exception e){}
Hope this helps.
(Sorry I can't put the real "less than" sign there )

[This message has been edited by Jim Dong (edited July 31, 2001).]
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you surround the sign by spaces, you can use a less than sign, like so: < And otherwise you can always use HTML escapes: &lt; should give <.
[This message has been edited by Peter den Haan (edited August 01, 2001).]
 
DirtyHarry
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The code displayed is not the code I wanted to display, The
< sign erased part of my code.
what should be read is :
for (int j=0;j<9;j++){
System.out.println(" values "+j+" = "+values[j]);
}catch(Exception e){}
Sorry about the confusion,
I'm anyway really surprised that no one else got this problem...
Does anybody knows if all the code for the certification are the same or does some little differences exists ?

Originally posted by Jim Dong:
Hi,
I believe that your code has little problem.
The following code
[b]
for (int j=0;j System.out.println(" values "+j+" = "+values[j]);
}catch(Exception e){}

should probably be:
for (int j=0; j less than values.length; j++) {
System.out.println(" values "+j+" = "+values[j]);
}catch(Exception e){}
Hope this helps.
(Sorry I can't put the real "less than" sign there )

[This message has been edited by Jim Dong (edited July 31, 2001).][/B]


 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Peter -- Wow, I am surprised you didn't say anything about DirtyHarry's name as not being acceptable.
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
The trailboss has a kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic