Clarity

  • 1.  Datasource SQLServer

    Posted Nov 19, 2010 11:06 AM
    Hi,
    I have a problem connecting to an external sqlserver database.

    When I launch a process with this Datasource in the gel script


    <sql:setDataSource driver="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver://localhost:1433"







    user="username"






    password="password"








    var="clarityDS"/>


    I get the following error:



    BPM-0704: An error occurred while executing custom script: org.apache.commons.jelly.JellyTagException: null:16:25: <sql:setDataSource> In &lt;driver&gt;, invalid driver class name: "com.microsoft.sqlserver.jdbc.SQLServerDriver" at org.apache.commons.jelly.tags.sql.SetDataSourceTag.doTag(SetDataSourceTag.java:116) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:247) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186) at com.niku.union.gel.tags.ScriptTag.doTag(ScriptTag.java:20) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:247) at com.niku.union.gel.GELScript.run(GELScript.java:80) at com.niku.union.gel.GELController.invoke(GELController.java:20) at com.niku.bpm.services.ExecuteCustomAction.run(ExecuteCustomAction.java:180) at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:727) at java.lang.Thread.run(Thread.java:595)


    Thanks
    Giuseppe


  • 2.  RE: Datasource SQLServer
    Best Answer

    Posted Nov 20, 2010 04:30 AM
    [color=#121E9C][size=4][font=Arial]Giuseppe,

    If you actually have access to the database you're trying to connect to then this is what I use:
    <core:set var="DB_Server_Name_or_IP"
    value="255.255.255.255" />
    
    <core:set var="DB_Database_Name"
    
    value="DBname"/>
    
    <core:set var="DB_user"
    
    
    value="username" />
    
    <core:set var="DB_password"
    
    value="password" />
    
    <core:set  var="Clarity_DB" value="jdbc:sqlserver://${DB_Server_Name_or_IP}:1433;databaseName=${DB_Database_Name};user=${DB_user};password=${DB_password};"/>
    <sql:setDataSource url="${Clarity_DB}" driver="com.microsoft.sqlserver.jdbc.SQLServerDriver" var="ClarityDS"/>
    Just remember you'll need the latest Microsoft JDBC driver files available from their website. These files should be in the lib folder of the XOG/GEL installation.

    sqljdbc_xa.dll

    sqljdbc_auth.dll

    sqljdbc4.jar

    sqljdbc.jar

    Hope this helps.

    Patrick
    [font][size][color]