lipeckham

GEL sql:setDataSource error

Discussion created by lipeckham on Aug 3, 2011
Latest reply on Aug 10, 2011 by lipeckham
Hi,

I'm a newbie at Gel, tasked with updating a script that has stopped working in Clarity. The script reads CVS files, and inserts the data into a database table for validation. To learn Gel, I've been running short scripts from the XOG command line on the developer machine.

I've run into a problem with an attempt to run a simple query currently used by the script. This is mostly a cut and paste job, using code from the old script. It ought to work, and I thought is was working, (a few days ago), but now it is failing, and I am getting nowhere trying to analyze it.
script (fragments)

 <gel:script>
<!-- namespace set-->
...
<!-- set up parameters, load properties.xml, and set some variables based on the properties -->
...
<!-- temporary output lines -->
   <gel:out>URL: ${DBurl}</gel:out>
   <gel:out>driver: ${DBdriver}</gel:out>

<!-- connect to the clarity db -->

   <!-- CONNECT TO THE CLARITY DB -->
   <sql:setDataSource url="${DBurl}" driver="${DBdriver}" user="${DBusername}" password="${DBpassword}"/>

   <!--Obtain the MAX Batch ID from the LDAP Staging Table-->
   <sql:query var="qryresult5">select 'test', max(batch_id) from zz_yrc_ldap</sql:query>
   <core:forEach trim="true" items="${qryresult5.rowsByIndex}" var="row">
      <core:set value="${row[1]}" var="batch" />
      <gel:out>Batch = ${batch}, TestInfo: ${testinfo}</gel:out>
   </core:forEach>

   <core:set var="batchID" value="${batch}+1" />
   <gel:out>New batch id is ${batchID}</gel:out>

 </gel:script>
I know the database is up, and that the query works, as I've tested it in Sql Developer on another machine.

What I get is:
> call c:\niku\clarity\scripts\gel\get_batchid.xml
URL: jdbc:clarity:oracle://acmtst:1527;SID=clardev1;BatchPerformanceWorkaround=t
rue;InsensitiveResultSetBufferSize=0;ServerType=dedicated;supportLinks=true
driver: com.ca.clarity.jdbc.oracle.OracleDriver
Command Failed: file:/c:/niku/clarity/scripts/gel/get_batchid.xml:24:106: <sql:s
etDataSource> com/ca/clarity/util/UtilDummyPrintWriter
The failure message makes no sense, at least to me. The referenced class is in a clarity folder, with other jar files (c:\Niku\clarity\lib\c-util.jar).

I've tried several things, including using the alternative <gel:setDataSource dbid="Niku"> (which results in a NullPointerException), and I'm getting nowhere. This script is run nightly, so I really need to get it fixed. Any suggestions appreciated.

Full script attached.

Should also note -- Clarity is at version (8.1.1.4445).

Outcomes