AnsweredAssumed Answered

JDBC parameters inside gel script gives errors

Question asked by whole_milk on Apr 11, 2014
Latest reply on Apr 11, 2014 by gcubed

We have the following code in the gel script, where it's connecting to an external remedy DB and querying it.:

<gel:script xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary" xmlns:jelly="jelly:core" xmlns:mail="jelly:email" 
xmlns:soap="jelly:com.niku.union.gel.SOAPTagLibrary" xmlns:sql="jelly:sql" 
<!-- Fetch Remedy incidents GEL SCRIPT -->
<!-- Remedy Database Parameters -->
<gel:parameter default="user_name" var="orap15User"/>
<gel:parameter default="password" secure="true" var="orap15Pass"/>
<gel:parameter default="0" secure="true" var="runoffset"/>
<!-- XOG Parameters -->
<gel:parameter default="admin" var="AppUser"/>
<gel:parameter default="clarity" secure="true" var="AppPass"/>
 
<!-- CONNECTION STRING TO orap15r -->
<sql:setDataSource var="remedy"
url="jdbc:oracle:thin:@(DESCRIPTION=
(ADDRESS=(PROTOCOL=TCP)
(HOST=oram15r)(PORT=1515))
(CONNECT_DATA=(SID=oram15r)))" 
driver="oracle.jdbc.driver.OracleDriver" 
password="${orap15Pass}" user="${orap15User}"/>
<!-- CONNECTION STRING TO warmDB -->
<gel:setDataSource dbId="Niku" var="warmDB"/>
<!-- TEST DATABASE CONNECTION(S) -->
<jelly:catch var="orap15Verify">
<sql:query dataSource="${remedy}" escapeText="false" var="results">SELECT 1 FROM DUAL</sql:query>
</jelly:catch>
<jelly:choose>
     <jelly:if test="${orap15Verify != null}">
        <jelly:set value="GEL process failed to connect to ORAP10 database. " var="interfaceDescription1"/>
        <gel:log level="FATAL" message="${orap15Verify}"/>
      </jelly:if>
<jelly:when test="${orap15Verify == null}">
<sql:query dataSource="${remedy}" escapeText="false" var="remedyrslt">SELECT * FROM ARADMIN.NYL_WOI_WORKINFO_CCN WHERE request_id='WWL000000000001'</sql:query>
<jelly:forEach trim="false" var="remedylist" items="${remedyrslt.rows}">
         <jelly:set value="Connected" var="remedylistout"/>
 
          <gel:log level="INFO" message="${remedylistout}" />
 
 </jelly:forEach>
</jelly:when>
</jelly:choose>
 
</gel:script>

 

We're getting the following error (while we are able to use the same credentials via toad):

org.apache.commons.jelly.JellyTagException: null:27:70: <sql:query> Unable to get connection, DataSource invalid: "ORA-01017: invalid username/password; logon denied "

We are trying to figure out the root cause but I'm wondering if any of you may have some insight or has extensive knowledge of using jdbc connections in a gel script. Thanks!! :)

Outcomes