Sita Yo

Greenhorn
+ Follow
since May 17, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sita Yo

Yes, I think so. The jni.h contains these method and I have already include them in the classpath and also use -I option to include the appropriate directory during compilation.
22 years ago
I am just trying to create a JVM from C program however I always got the following error message during compilation. I have already include the path of the jni.h and jni_md.h during compilation
/tmp/cc8LnTgM.o: In function `main':
/tmp/cc8LnTgM.o(.text+0xc3): undefined reference to `JNI_GetDefaultJavaVMInitArgs'
/tmp/cc8LnTgM.o(.text+0xfa): undefined reference to `JNI_CreateJavaVM'
/tmp/cc8LnTgM.o(.rodata+0x74): undefined reference to `Java_test_MainWithNatives_native0'
/tmp/cc8LnTgM.o(.rodata+0x80): undefined reference to `Java_test_MainWithNatives_native1'
collect2: ld returned 1 exit status
Does anyone know how the causes of such error message and how to solve it?

Thanks
22 years ago
jni
in fact I have included the jni.h, perhaps there is some error due to cut and paste. Still the same errors appear
Regards
22 years ago
jni
Hi
I always got the following error message. Does anyone knows the causes of such error messages? Thanks
p28.c: In function `Java_p28_setAPrivate':
p28.c:6: request for member `GetObjectClass' in something not a structure or union
p28.c:7: request for member `GetFieldID' in something not a structure or union
p28.c:8: request for member `SetIntField' in something not a structure or union
Here is my source code
---------------------------------------------------------------
#include "p28.h"
#include <jni.h>
JNIEXPORT void JNICALL Java_p28_setAPrivate(JNIEnv *env, jobject thisObj, jint val)
{
jclass clazz = env->GetObjectClass(thisObj);
jfieldID fid = env->GetFieldID (clazz, "aPrivate","I");
env->SetIntField(thisObj,fid,val);
}
---------------------------------------------------------------
public class p28
{
private int aPrivate=0;
protected int aProtected=0;
public int aPublic=0;
private static int aStaticPrivate=0;
protected static int aStaticProtected=0;
public static int aStaticPublic =0;
public void printAPrivae()
{
System.err.println("A Private = " + aPrivate);
}
public void printAProtected()
{
System.err.println("A Protected = "+ aProtected);
}
public void printAStaticPrivate()
{
System.err.println("A StaticPrivate = "+ aStaticPrivate);
}
public void printAStaticProtected()
{
System.err.println("A StaticProtected = "+aStaticProtected);
}
public native void setAPrivate(int val);
public native void setAStaticPrivate(int val);
}
---------------------------------------------------------------
22 years ago
jni
I am trying build the a share library using the jni. However whenever I try to execute this command but it always complain:
cc -G -I/usr/bin/java/include -I/usr/bin/java/include/solaris HelloWorldImp.c -o libhello.so
/HelloWorld.h", line 2: Can't find include file jni.h
Can anyone help? Thanks!
22 years ago
Yes, thanks and I am now looking for the oracle odbc drivers for the linux machine!

Originally posted by Frank Carver:
This is not exactly a reply to your question, but I have to ask why you want to use the somewhat limited and flaky jdbc/odbc bridge to talk to an odbc/oracle bridge whan you can use the much more full-featured oracle "thin" driver (a free download from Oracle) directly.


The oracle database is installed on a Unix machine and I am using another linux machine with jdk1.3, but they are on the same network. Sorry I am not really familiar with oracle. How can I use the "this" driver?
Thanks!
I am trying to access an oracle database from a linux machine using Java programs. I try to load the oracle driver using:
Class.forName("sun.jdbc.odbc.OracleDriver");
However I got an message:
java.lang.ClassNotFoundException: sun/jdbc/odbc/OracleDriver
Does anyone know if there is any Orale Odbc drivers for Jdk1.3 on linux? Or where can I donwload it?
Thanks
Yes, that's right! But I need to load the driver first using:
Class.forName("sun.jdbc.odbc.OracleDriver");
However it got another message:
java.lang.ClassNotFoundException: sun/jdbc/odbc/OracleDriver
I think I don't have the Oracle drive in my machine. How can I install the Oracle driver in the linux machine??
Can anyone help me?!
Thanks
22 years ago
Hi
I am using a linux machine and I want to retrieve data from an Oracle database (on a unix machine) in the same network. But I don't have any Pro C. Can anyone give me any idea what can I do on this linux machine to retrieve data from the database? How can I use C or Java to access the database on another machine?
Thank you!
Hi
I need to retrieve data from an Oracle database(on a unix machine) from another linux machine in the same network? Can anyone give me some ideas how I can do it? Using ordinary Java programs can do?
Thanks
22 years ago
I am woking on the Red Hat Linux machine, I have downloaded the rpm for jdk1.3 and jre1.3 and successfully installed. But I can't find the javah. Is there anything I'v done wrong?
I have installed the jdk1.3 on my windows pc and I got the javah under the java/bin directory. I don't know why I can't find the javah on the linux machine.
Thanks
22 years ago