I am using Scott's JDBC service and having a problem with
JDBC_FreeResult. When I call this function after I make a
JDBC_ExecPrepQry and JDBC_NextRow, the next time I try use my
statement object the program crashes and when I check I find that the
statement object has been destroyed.

When I look at the JDBC_FreeResult function I see that it destroys the
statement object in addition to releasing the result object. I believe
this is a bug. The big problem with this is that when you examine the
statement object in the RPG debugger the object still shows as being
valid but the object has been destroyed in the Java run time.

Scott I sent this your feedback but didn't hear anything so posting here.

P JDBC_FreeResult...
P                 B                   export
D JDBC_FreeResult...
D                 PI
D   rs                                like(ResultSet)
D stmt            s                   like(Statement)
 /free
     stmt = rs_getStatement(rs);
     stmt_close(stmt);                             <<--------------
     DeleteLocalRef(JNIENV_P: rs);
     DeleteLocalRef(JNIENV_P: stmt);      <<--------------
     rs = *NULL;
 /end-free
P                 E

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.