• Post Reply Bookmark Topic Watch Topic
  • New Topic

Interacting with Microsoft Access  RSS feed

 
Rocky Rocha
Ranch Hand
Posts: 43
Android Chrome Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been making a database that consists of text files and folders. I have decided to abandon the idea and make a new form of that database using Microsoft access files. I have been doing a bit of research to figure out if I can do this easily. I have a basic understanding of java and a complex understanding of programming. If anyone can provide me with a base for a program that does what I am asking, then please respond with instruction or a complete program as well as ways to do various tasks like editing data, adding new entries, displaying the entries, and filtering through the entries. Thank you for your time!
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37181
515
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Java, we use JDBC to access a database. See the JDBC trailfor more details.
 
Tim Moores
Saloon Keeper
Posts: 3834
80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HXTT is a commercial JDBC driver for Access. If you're not set on JDBC, have a look at the open source Jackcess library.
 
Rocky Rocha
Ranch Hand
Posts: 43
Android Chrome Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have looked at JDBC  and I have found very little help on it.
I have used


and



to do it, but It has not worked for me. The Main class is to test that everything is in working order. Tell me how to fix it if it can be fixed.
 
Rocky Rocha
Ranch Hand
Posts: 43
Android Chrome Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course, that is for MySQL. I need some code for Access.
 
Tim Moores
Saloon Keeper
Posts: 3834
80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you evaluated either of the solutions I mentioned?
 
Rocky Rocha
Ranch Hand
Posts: 43
Android Chrome Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HXTT is not n option as this is meant to be a no-cost project. I plan to put it on GitHub and see how well it does and then launch it into full development if it does well.

Jackcess I don't know how to use. If you could give an explanation of how to install it, I will gladly listen. It does seem to be exactly what I need but, I don't know how to use it.
 
Tim Moores
Saloon Keeper
Posts: 3834
80
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Start with the Jacksess home page, the FAQ and the cookbook page. Between them, they provide a fair amount of information to get you going. If you get stuck, report back here with what you tried, and how that didn't work, and we'll try to help.
 
Rocky Rocha
Ranch Hand
Posts: 43
Android Chrome Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have found it to be impossible to

I use eclipse IDE if that has anything to do with it. If you have any answers, you can try. I am using Java SE 8. Specifically 8u131.
 
Tim Moores
Saloon Keeper
Posts: 3834
80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where did you get those imports from? In the cookbook, I see classes like Database, Table, Row and Cursor - all of which are in the com.healthmarketscience.jackcess package. For those you'll need to add the Jackcess jar file to the classpath.
 
Knute Snortum
Sheriff
Posts: 3974
98
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have found it to be impossible to...

It's important to clearly describe what's happening.  Are you getting an error about how the import cannot be resolved?  If so, make sure the jar file you downloaded can be found.  In Eclipse, you can add the jar file as a library.

1) Right-click the program in the Package Explorer
2) Select Build Path...
3) Select Configure Build Path
4) Click on the Libraries tab
5) Click Add External Jars...
 
Rocky Rocha
Ranch Hand
Posts: 43
Android Chrome Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is the code I am using to test it.


I am getting an error that goes as follows
 
Dave Tolls
Ranch Hand
Posts: 2839
30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you got all the dependencies they mention here?
http://jackcess.sourceforge.net/dependencies.html

(Excluding the optional ones)

(ETA: that looks like just the two, commons-lang and commons-logging)
 
Rocky Rocha
Ranch Hand
Posts: 43
Android Chrome Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have attached an image with all the libraries I have added. I still get this error.
LIBRARIES.PNG
[Thumbnail for LIBRARIES.PNG]
all libraries I have added
 
Ron McLeod
Saloon Keeper
Posts: 1564
222
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Version 2.X and 3.X of the Commons Lang API use different packages: org.apache.commons.lang vs. org.apache.commons.lang3.

It looks like jackcess needs  the 2.X library, rather than the 3.X version that you currently have.
 
Rocky Rocha
Ranch Hand
Posts: 43
Android Chrome Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can I get a link to download that
 
Ron McLeod
Saloon Keeper
Posts: 1564
222
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rocky Rocha wrote:can I get a link to download that

Probably best to go to the Download Apache Commons Lang page.
 
Rocky Rocha
Ranch Hand
Posts: 43
Android Chrome Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I imported it into the project and now I found out that logging is a separate thing. I need a download link to that.
 
Ron McLeod
Saloon Keeper
Posts: 1564
222
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Refer to the link that Dave provided for the dependencies and versions, then use Google to search for a site where you can download them.

For example, for the logging jar, search for: commons-logging 1.1.3 jar download
 
Rocky Rocha
Ranch Hand
Posts: 43
Android Chrome Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, I was able to get it working. Do you know how to get the value of a field of a certain ID number?
 
Dave Tolls
Ranch Hand
Posts: 2839
30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ron McLeod wrote:
It looks like jackcess needs  the 2.X library, rather than the 3.X version that you currently have.


According to the page above, it's 2.6 for lang and 1.1.3 for logging.
 
Knute Snortum
Sheriff
Posts: 3974
98
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just as a side note: Maven and Gradle are designed to deal with all these kinds of problems.  You might look into using one of them for anything larger than a trivial program.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!