Results 1 to 8 of 8
  1. #1
    Join Date
    Dec 2003
    Posts
    11

    Unanswered: How to call the store procedure(sqlj.install_jar) using jdbc?

    Client OS: Windows 2000
    Server OS : Redhat Linux 8.0
    Database: Informix 9.4

    How to call the store procedure(sqlj.install_jar) using jdbc?

    My code as following but doesn't work.

    private CallableStatement cblStatement = null;

    cblStatement = cn_any.prepareCall("{call sqlj.install_jar(?,?)}");
    cblStatement.setString(1,"file:C:/UDR/myudr.jar");
    cblStatement.setString(2,"myudr.class");
    cblStatement.executeUpdate();

    Is there anyone can help me?

    Thanks.

  2. #2
    Join Date
    Oct 2003
    Posts
    29
    How to call the store procedure(sqlj.install_jar) using jdbc?
    Client OS: Windows 2000
    Server OS : Redhat Linux 8.0
    Database: Informix 9.4

    How to call the store procedure(sqlj.install_jar) using jdbc?

    My code as following but doesn't work.

    private CallableStatement cblStatement = null;

    cblStatement = cn_any.prepareCall("{call sqlj.install_jar(?,?)}");
    cblStatement.setString(1,"file:C:/UDR/myudr.jar");
    cblStatement.setString(2,"myudr.class");
    cblStatement.executeUpdate();

    Is there anyone can help me?

    Thanks.

  3. #3
    Join Date
    Oct 2003
    Posts
    29
    Make sure you have taken care of these things

    1) the jar you have provided seems to be
    on windows while your engine is on linux box.
    I think you need to put you jar on same linux box or some place
    where engine can find it.
    for exaple you can copy it to
    /tmp/myudr.jar and set first parameter as "file:/tmp/myudr.jar"

    2) Secondly wonder if using alias "myudr.class" causing any problem .
    try and use "myudr_class" intead.
    3) Make sure you have setup Java UDR support in your engine
    by setting necessary parameters in onconfig etc.
    Refer to admin guide for same
    4) Make sure you have defined SYSSBSPACE and added same to the
    instance.

  4. #4
    Join Date
    Dec 2003
    Posts
    11
    Hi Amit Dandekar ,
    Thank you for your reply.
    I've run the install_jar successfully with your solution #1.
    But I've got another error, the situation as following:

    case 1: My java source code has the package
    package com.my.udr;
    public class Hello{
    public static String HelloWorld() throws Exception{
    String str = "Hello World!";
    return str;
    }
    }

    case 2: My java source code has no the package
    public class Hello{
    public static String HelloWorld() throws Exception{
    String str = "Hello World!";
    return str;
    }
    }

    Step 1. compile the source.
    Step 2. make the jar file.
    Step 3. run the procedure sqlj.install_jar(...).
    Step 4. execute the function HelloWorld().

    Case 2. is no problem but it got an error in the step 4 of the Case 1.

    9479: Unknown throwable: (Cannot convert param:zh_tw).

    What is the problem of the package?

    Thanks...

  5. #5
    Join Date
    Dec 2003
    Posts
    11
    I've fixed my problem. It was a problem of $LANG.

    Thanks

  6. #6
    Join Date
    Dec 2003
    Posts
    11
    Originally posted by Amit Dandekar
    Make sure you have taken care of these things

    1) the jar you have provided seems to be
    on windows while your engine is on linux box.
    I think you need to put you jar on same linux box or some place
    where engine can find it.
    for exaple you can copy it to
    /tmp/myudr.jar and set first parameter as "file:/tmp/myudr.jar"

    2) Secondly wonder if using alias "myudr.class" causing any problem .
    try and use "myudr_class" intead.
    3) Make sure you have setup Java UDR support in your engine
    by setting necessary parameters in onconfig etc.
    Refer to admin guide for same
    4) Make sure you have defined SYSSBSPACE and added same to the
    instance.
    Hi Amit Dandekar ,
    Thank you for your reply.
    I've run the install_jar successfully with your solution #1.
    But I've got another error, the situation as following:

    case 1: My java source code has the package
    package com.my.udr;
    public class Hello{
    public static String HelloWorld() throws Exception{
    String str = "Hello World!";
    return str;
    }
    }

    case 2: My java source code has no the package
    public class Hello{
    public static String HelloWorld() throws Exception{
    String str = "Hello World!";
    return str;
    }
    }

    Step 1. compile the source.
    Step 2. make the jar file.
    Step 3. run the procedure sqlj.install_jar(...).
    Step 4. execute the function HelloWorld().

    Case 2. is no problem but it got an error in the step 4 of the Case 1.

    9479: Unknown throwable: (Cannot convert param:zh_tw).

    What is the problem of the package?
    I still have the problem.

    Thanks...

  7. #7
    Join Date
    Dec 2003
    Posts
    11
    Originally posted by Amit Dandekar
    Make sure you have taken care of these things

    1) the jar you have provided seems to be
    on windows while your engine is on linux box.
    I think you need to put you jar on same linux box or some place
    where engine can find it.
    for exaple you can copy it to
    /tmp/myudr.jar and set first parameter as "file:/tmp/myudr.jar"

    2) Secondly wonder if using alias "myudr.class" causing any problem .
    try and use "myudr_class" intead.
    3) Make sure you have setup Java UDR support in your engine
    by setting necessary parameters in onconfig etc.
    Refer to admin guide for same
    4) Make sure you have defined SYSSBSPACE and added same to the
    instance.
    I've checked the jvp.log as following:
    loading native library /u/informix/extend/krakatoa/libjvp.so
    Read JVP property file/u/informix/extend/krakatoa/.jvpprops
    2003/12/10 12:12:18.595 JVP#3: TraceableImpl: trace settings property is null
    DBAThread Pool is enabled with size = 20 with patrol interval = 5
    2003/12/10 12:12:18.758 JVP#3: DBA API: binding to '/anonymous:3/ServiceDirector
    y'
    Alarm Time set to 3
    2003/12/10 12:12:18.762 JVP#3: ServiceDirectory rebind err: Connection refused t
    o host: 10.20.11.233; nested exception is:
    java.net.ConnectException: ?s?u?Q???
    2003/12/10 12:12:18.778 JVP#3: Could not connect to RMI, rmiregistry probably no
    t running
    2003/12/10 12:12:18.788 JVP#3: Registering service Logger
    2003/12/10 12:12:18.789 JVP#3: Registering service Tracer
    PARAM is not NULL

  8. #8
    Join Date
    Dec 2003
    Posts
    11
    I've solved my problem already.

    Thanks
    Last edited by chet199308; 12-14-03 at 22:13.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •