Clarity

  • 1.  How to set datasource sql server db in a gel script to connect to the db

    Posted Oct 11, 2016 11:32 AM

    Hello,

     

    I am wandering if anyone know how to set datasource for sql server to connect to the database. I already did that on the past with Oracle. Below how I connect to the database :

     

    <!--DATA SOURCE ORACLE SQL-->
      <core:choose>
      <core:when test="${context != 'TRAIN'}">
        <sql:setDataSource var="DS_SRC"
            url="jdbc:oracle:thin:@${hostORA}:${portORA}:${sidORA}"
            driver="oracle.jdbc.driver.OracleDriver"
            user="${loginORA}"
            password="${passORA}"/>
          
      </core:when>
      <core:otherwise>
       <sql:setDataSource  url="jdbc:clarity:oracle:${hostORA}:${portORA};ServiceName=${sidORA}"
           driver="oracle.jdbc.driver.OracleDriver"
           user="${loginORA}"
           password="${passORA}"
           var="DS_SRC"/>
      </core:otherwise>
     </core:choose>

     

    I want to do the same with SQL Sever.

     

    Thank in advance for answer.

     

    Kind regards



  • 2.  Re: How to set datasource sql server db in a gel script to connect to the db
    Best Answer

    Posted Oct 11, 2016 12:04 PM

    Here is how I do it for running command line scripts.

     

         <sql:setDataSource url="jdbc:sqlserver://localhost;databaseName=niku;integratedSecurity=true;" driver="com.microsoft.sqlserver.jdbc.SQLServerDriver" user="niku" password="password" var="clarityDS" />
         <sql:query dataSource="${clarityDS}" var="myQuery">

     

    This assumes that you have the JDBC SQLServerDriver installed.  The url configuration:

     

    Building the Connection URL 

     

     

    V/r,

    Gene



  • 3.  Re: How to set datasource sql server db in a gel script to connect to the db

    Posted Oct 13, 2016 03:27 AM

    Thank you I will try that and let you know !



  • 4.  Re: How to set datasource sql server db in a gel script to connect to the db

     
    Posted Oct 17, 2016 06:24 PM

    Hi KarimD - Did gcubed's response help answer your question? If so please Mark Correct. Thanks!