Hi Rony,

another little problem: at the beginning I used Windows_BSF4ooRexx_Setup_406-20110822-x64.exe

Because of my problem I download the new version, uninstalled 406 with the function, that was available in the

Windows Menu and installed BSF4ooRexx_install-20130107-GA.zip as described in bsf4oorexx\install\readme-Windows.txt.

 

After the installation, I had once various issues:

1.       I could’nt start the jrexx scripts as before (instead my editor opened with the script)

2.       In attempt to solve the problem I wanted to start SetupBSF.rex and got

 

C:\Program Files\BSF4ooRexx\install>rexx setupBSF.rex

   241 *-* call SysFileTree cmd.eSuperDir2||"bsf*.jar", "cmd.eJarBaseNames.", "FO" /* query for the jars we need */

Error 40:  Incorrect call to routine

Error 40.919:  Argument 2 must have a stem object or stem name value; found "cmd.eJarBaseNames."

 

The solution: I copied BSF4ooRexx.dll, libBSF4ooRexx.dylib and libBSF4ooRexx.so from C:\Program Files\BSF4ooRexx\install\64  to the C:\Program Files\BSF4ooRexx,

run setupFileAssociations.rex and three fileAssociations_for_RE*_add.reg files (don’t know I any was necessary).

 

After changing the extension of my script I could continue with my JDBC Tests, but I’m not sure that anything is now correctly installed!?

What I lost are the entries in the Windows Menu.

 

So it seems to me that the installation instruction in the readme are not complete or the C:\Program Files\BSF4ooRexx\install\windows\install.cmd don’t work correct.

Or did I miss something?

Regards

Roger

 

 

Von: Rony G. Flatscher [mailto:Rony.Flatscher@wu.ac.at]
Gesendet: Dienstag, 13. August 2013 16:35
An: bsf4oorexx-support@lists.sourceforge.net
Betreff: Re: [Bsf4oorexx-support] Exception handling with BSF4oorexx and JDBC and DB2

 

Hi Roger,

On 8/13/2013 4:05 PM, Roger Bilau wrote:

you're totally right – and found the solution, as you can see below . It works!!!

Great, that it works now!

Thanks a lot for your help (for the moment ;-))

You are very welcome!

And please, come forward if you need any further help, background infos, etc.!

Best regards,

---rony


The code:

syntax:

trace i

-- fragment that should reside in your syntax condition handling code

 

   jexc=condition("Additional")~at(2)   -- second entry in the ooRexx array

   say "jexc:" jexc

   say "jexc~toString:" jexc~toString   -- let the Java object create a string value

 

   jobj=jexc~getTargetException  -- <== fetch the original exception

   say "jobj:" jobj 

   say "jobj~toString:" jobj~toString   -- let the Java object create a string value

  

   jobj=jobj~getCause -- replace the Rexx variable with the causing Java exception object

   say "jobj now:" jobj

   say "jobj~toString:" jobj~toString   -- let the Java object create a string value

 

 

   if jobj~bsf.isA('com.ibm.db2.jcc.DB2Diagnosable') then

   do

      -- now you know that that exception has all methods from DB2Diagnosable!

       sqlca=jobj~getSqlca

       say "sqlCode ="sqlca~getSqlCode

       say "sqlState="sqlca~sqlState   -- note: BSF4ooRexx treats Java "get" methods as ooRexx getter methods (one can omit the prefix "get" in ooRexx)

       say "sqlMsg  ="sqlca~getMessage

       say "sqlErrmcTokens =" sqlca~getSqlErrmcTokens

       say "sqlErrd ="sqlca~getSqlErrd

       say "sqlErrp ="sqlca~getSqlErrp

       say "sqlErrmc =" sqlca~getSqlErrmc

       say "sqlWarn ="sqlca~getSqlWarn

       -- ...

   end

  return

 

The results:

jexc: org.apache.bsf.BSFException@11b1db9a

jexc~toString: org.apache.bsf.BSFException: /// Java-exception (RexxAndJava) occurred: [java.lang.reflect.InvocationTargetException], getCause():

[com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=as;select count(* ;), DRIVER=3.64.114] \\\

BSF4ooRexx subfunction "invoke": object 'com.ibm.db2.jcc.am.io@59f55efc' - method [EXECUTEQUERY], method not found or error (exception) executing

method!

jobj: java.lang.reflect.InvocationTargetException@1a33f652

jobj~toString: java.lang.reflect.InvocationTargetException

jobj now: com.ibm.db2.jcc.am.SqlSyntaxErrorException@7f575ec

jobj~toString: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=as;select count(* ;), DRIVER=3.6

4.114

sqlCode =-104

sqlState=42601

sqlMsg  =Auf "select count(* " folgte das unerwartete Token "as".  Zu den möglichen Token gehören: ")".. SQLCODE=-104, SQLSTATE=42601, DRIVER=3.6

4.114

sqlErrmcTokens = [Ljava.lang.String;@1910cd6d

sqlErrd =[I@1098e5da

sqlErrp =SQLNP01F

sqlErrmc = as;select count(* ;)

sqlWarn =[C@a6eaa3a

 

And – maybe for more understanding – the trace output:

... cut ...