Java Native Interface (JNI) - how to handle the object returned from C to java
I am new to JNI,
this is a way i am tryig out.
I defined java class as
public class sample2struc
{
public String Myname;
public void sample1struc() {};
public void setMyname(String Myname)
{
this.Myname = Myname;
}
public String getMyname()
{
return Myname;
}
}
the c implementation
JNIEXPORT jobject JNICALL Java_sample1_readFile
(JNIEnv *env, jobject obj)
{
struct emp e;
strcpy(e.name,"Siva");
jclass cls = env->FindClass("sample1struc");
jmethodID mid = env->GetMethodID(cls,"<init>","()V");
jobject xinstance = env->NewObject(cls,mid);
jmethodID setterid = env->GetMethodID(cls,"setSCPname","(Ljava/lang/String;)V");
xinstance = env->NewObject(cls,setterid,&e.no);
return cls;
}
my main problem started here, i dont know how to catch the cls object and retrieve the data from that class.
In fact i need to pass the structure array from C to java and retriev those details in java and display them on JSP screen.
Can any one please help me out in this issue.

