Solved

Java load msjet40.dll library?

Posted on 2013-10-24
6
391 Views
Last Modified: 2013-10-25
I'm sure this is a simple thing to do, but for the life of me I can't figure it out.

All I'm trying to do is load the msjet40.dll library into Java.

I do not have access to JNA (it's a closed network).

I only need to use a small handful of functions/methods/objects from the library.

Can someone give me an actual code example?  With a start, I could run from there.
0
Comment
Question by:Javin007
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 27

Accepted Solution

by:
mrcoffee365 earned 500 total points
ID: 39598704
Would you describe a little more of what you want to do?  You don't really load a .dll into a Java executable.  A java executable can invoke methods from a .dll .  However -- do you just want to run some queries against an Access db?  Then you set up a database Connection to the Access db -- you don't have to "load" the Jet .dll .

However, if what you want is to execute some of the internal commands available within the MS Access environment -- and if you know that they're available in the .dll -- then you have to do a COM call from Java to the .dll .  JNA (wrapping the generic JNI) is one of the ways to do that.  Anyway -- a royal pain to do, but it is possible.  Jet has to make the call available -- it might not be.

Describe what you want to do, and we'll be able to help more.
0
 
LVL 4

Author Comment

by:Javin007
ID: 39598727
Specifically, I need to modify the TableDef in a JET 4.0 (MS Access 2000) database.  (Even more specifically, I need to modify about 200 scattered over many .MDB files).  

I think I've drilled down that I actually need to use DAO360.dll rather than msjet40, but that's just details.

Unfortunately, this is on a closed network, and they do not have JNA installed.  Thus, everything will have to be done manually.  (I assume I'm still attempting to use JNI here?)

I'm fairly new to Java, and kind of muddling my way through this.

I currently have:

System.loadLibrary("dao360");

Open in new window


Annnnnd, that's about as far as I've managed to get without throwing an error.  I assume there's a good number of requisite "native" objects and methods I'd need to create?   Still stumbling through how external DLLs and Java play together...
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 39598867
As i'm afraid you'll discover, Java isn't really the tool for the job. Why, e.g. do you not use C#?
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
LVL 4

Author Comment

by:Javin007
ID: 39598875
Basically, due to the customer.  Had I had it my way, we would be using .NET and SQLite at the very least, but they insist on Java and Access 2000.
0
 
LVL 27

Expert Comment

by:mrcoffee365
ID: 39600737
For some development environments, we use Java extensively with Access db's and it works fine.  However, we don't change the TableDef links -- I see a lot of questions from you around that.  Microsoft never really published easy ways to do that with Access, so it can be a problem.  This is a problem whether you use the C# and .Net world, or use Java as your programming environment.  Calling COM objects in C# and .Net has more support in Visual Studio than Eclipse offers to Java programmers, but they're all just programs running in an operating system -- no need to switch the entire architecture.

However, there are people who write programs which dive into the internals of the Jet engine -- which is what you say you want to do.  It is a lot of work -- not because of Java but because MS doesn't make it an easy thing to do.

You realize that if you require the dao library in your Java code, you're back to requiring that Access be installed on the user's system in order to run your program?
0
 
LVL 4

Author Comment

by:Javin007
ID: 39600767
Indeed, I ultimately found a way around it all together.  I push small chunks of data from the "external" databases to the "core" database, run my report, then nuke the changes.  A bit sloppy, but in the end, turns out it actually runs FAR faster than running the queries across the links anyway, and now I don't need the links at all (or the DAO library).  Still, I gave you the points since, according to my question, yours would have been the "correct" answer.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question