Solved

Jdbc to Informix

Posted on 1998-04-29
9
361 Views
Last Modified: 2010-08-05
Im trying to get any kind of connection to a Informix
database from a java applet. Im using version 7.24.
I have set CLASSPATH to the infromix.jar file and
LD_LIBRARY_PATH to sparc directory.

And when i try to run a javaprogram to access the database
I get:
ld.so.1: /pkg/java/jdk-1.1.5/bin/sparc/green_threads/java: fatal: libifdmi.so: can't open file: errno=2 (libIfmxLibmiNatives.so)
Exception occurred during event dispatching:
java.lang.UnsatisfiedLinkError: no IfmxLibmiNatives in shared library path
        at java.lang.Runtime.loadLibrary(Runtime.java)
        at java.lang.System.loadLibrary(System.java)
        at
        at
        at informix.api.direct.DirectCredentials.connection(DirectCredentials.java:166)
        at csql.createConnection(csql.java:96)
        at ExampleApplet.actionPerformed(ExampleApplet.java:250)
        at java.awt.Button.processActionEvent(Button.java:254)
        at java.awt.Button.processEvent(Button.java:227)
        at java.awt.Component.dispatchEventImpl(Component.java:1764)
        at java.awt.Component.dispatchEvent(Component.java:1704)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:63)
Can anyone help me with this problem???

/Mats
0
Comment
Question by:mny
  • 5
  • 2
  • 2
9 Comments
 

Author Comment

by:mny
ID: 1220178
Edited text of question
0
 

Author Comment

by:mny
ID: 1220179
Edited text of question
0
 
LVL 1

Accepted Solution

by:
cph earned 100 total points
ID: 1220180
Did you define the path of your java directory if so do it.
It's something like:
set CLASSPATH=c:\jdk1.1.3\lib\classes.zip
or under NT, it's in your control panel->System->Environment. There, you should see a variable called CLASSPATH.

Hope this help,
CpH

0
 

Author Comment

by:mny
ID: 1220181
I shure have!
And by the way I missed out that i'm using Sun Solaris
/Mats
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 5

Expert Comment

by:fontaine
ID: 1220182
Java tries to load a dynamic library called "IfmxLibmiNatives.so". But this fails because you don't have a library path set up correctly. The library path is a list of directories that the Java runtime system searches when loading libraries.  To set up this under UNIX, the command is:

% setenv LD_LIBRARY_PATH directorypath

where directorypath is the name of the directory that contains the IfmxLibmiNatives.so library.

From what you wrote, I guess that this library is missing from your "sparc" directory. If not, be sure that the environment variable is available to the virtual machine that runs the applet. I don't remember if setenv only defines the environment for the shell the command is issued in. Be carefull about that. For example, try with an AppletViewer launched from the same shell that the one you used to define LD_LIBRARY_PATH.

You should note that you are going to face another problem with applets: you can't load dynamic libraries if the applet is not signed. But that's another problem.

Tell me if your problem is solved.
0
 

Author Comment

by:mny
ID: 1220183
Well fontaine.
I the file IfmxLibmiNatives.so is in the sparc directory
and the sparc directory is in my LD_LIBRARY_PATH
and i set the LD_LIBRARY_PATH in the same shell as
im trying to both compile and run the applet.
So what am I missing???

/mny
0
 
LVL 1

Expert Comment

by:cph
ID: 1220184
Did you look for the file libifdmi.so?

0
 

Author Comment

by:mny
ID: 1220185
Well cph im not shure what U mean.
I know where libifdmi.so is located and I have it in my path
(if that was what u meant)
/mny
0
 
LVL 5

Expert Comment

by:fontaine
ID: 1220186
Your installation seems OK. The problem is for sure with the LD_LIBRARY_PATH environment variable. Do you ever tried to use a dynamic library from a program on your system? Your problem is maybe not Java specific. Are you using a JIT ? If yes, turn it off. I have read that some JIT have problems with JNI.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
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…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
The viewer will learn how to implement Singleton Design Pattern in Java.

760 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now