Solved

Jdbc to Informix

Posted on 1998-04-29
9
367 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
[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
  • 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

Author Comment

by:mny
ID: 1220181
I shure have!
And by the way I missed out that i'm using Sun Solaris
/Mats
0
 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
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:
The viewer will learn how to implement Singleton Design Pattern in Java.

728 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