?
Solved

Jdbc to Informix

Posted on 1998-04-29
9
Medium Priority
?
368 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 200 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
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…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses
Course of the Month13 days, 10 hours left to enroll

800 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