Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Writing a .csv file from.mdb file with Jackcess

 
Awet Haddis
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • 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.
 
Paul Clapham
Sheriff
Posts: 20711
29
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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.
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thank-you very much guys.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic