• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Writing a .csv file from.mdb file with Jackcess

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,

I am writing a java application that will write the data in the access database to a text file.

My code looks like this:


The errors I am receiving are confusing me as I am new to database programming

Errors:Exception in thread "main" java.lang.Error: Unresolved compilation problems:
db cannot be resolved
out cannot be resolved

at Harvest.Test.dumpDatabase(Test.java:33)
at Harvest.Test.main(Test.java:84)

Any help would be appreciated, thank-you.
 
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nothing to do with JDBC, just basic Java. In this line of code:

there is no variable named "db" in a scope enclosing it.

By the way it would help if you used the "Code" tags around your code, and indented it. You could even edit your post and do that now. It would be much easier for people to read then.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Promise us you'll never, ever, do this again:

You simply must handle IOExceptions, even if handling consists only of printing an error message to a log file or console where you'll notice it.

Edited:

Paul Clapham wrote:By the way it would help if you used the "Code" tags around your code, and indented it. You could even edit your post and do that now. It would be much easier for people to read then.


I did that just now, so remember to do it yourself next time, and forever after :-)
 
Awet Haddis
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank-you very much guys.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic