Solved

Jdbc to Informix

Posted on 1998-04-29
9
363 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
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…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

895 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

13 Experts available now in Live!

Get 1:1 Help Now