JNI Calling C and Informix


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: JNI Calling C and Informix

  1. #1
    Buyong H Hussain Guest

    JNI Calling C and Informix


    Dear All,

    I have these program written in Informix7 and C.
    The problem is I need to call both program through Java JNI program.
    Well, below is my steps:

    1.I create java program called Average.java
    2.Compiled using javac Average.java --> got Average.class
    3.Create header file using javah -jni Average --> got Average.h
    4.I created C native program called AverageImp.c
    5.Now the problem is:
    - This C program is linked with Informix object file (lets say Client.4gl/o).
    - ..using fgl_start() and fgl_call() inside fglapi.h include file.

    - Now how do I linked both program and create shared library in
    the system?
    - Do I use cc -G or c4gl -c or ld -G ?
    - Which compiler should I used...C or Informix?

    Please anybody can help me?

    Thanks for your attention.

    -buyong 006-03-9802643-




  2. #2
    Ruchi Dhar Guest

    Re: JNI Calling C and Informix


    I don't remember exact command line arguments but the solution is you have
    to create an position independent object file using C compiler. I think
    you can use ar command in unix to create such position independent object
    file and keep that file in your SHLIB_DIR. I hope this solves your problem.

    "Buyong H Hussain" <buyong@rhb.com.my> wrote:
    >
    >Dear All,
    >
    >I have these program written in Informix7 and C.
    >The problem is I need to call both program through Java JNI program.
    >Well, below is my steps:
    >
    >1.I create java program called Average.java
    >2.Compiled using javac Average.java --> got Average.class
    >3.Create header file using javah -jni Average --> got Average.h
    >4.I created C native program called AverageImp.c
    >5.Now the problem is:
    > - This C program is linked with Informix object file (lets say

    Client.4gl/o).
    > - ..using fgl_start() and fgl_call() inside fglapi.h include file.
    >
    > - Now how do I linked both program and create shared library in
    >the system?
    > - Do I use cc -G or c4gl -c or ld -G ?
    > - Which compiler should I used...C or Informix?
    >
    >Please anybody can help me?
    >
    >Thanks for your attention.
    >
    >-buyong 006-03-9802643-
    >
    >
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center