Execute SQL Query on Sybase Error

book

Article ID: 131762

calendar_today

Updated On:

Products

CA Release Automation - Release Operations Center (Nolio) CA Release Automation - DataManagement Server (Nolio)

Issue/Introduction

Trying to use the action: Execute SQL Query on Sybase Database Server
results in an error. The error output from action:

Description: 
An error occurred during database connection establishment
Failed to initialize driver: com.sybase.jdbc3.jdbc.SybDriver
com.sybase.jdbc3.jdbc.SybDriver

error code: 0



When reviewing the nolio_all.log file it shows us the following:

2019-05-06 16:01:22,763 [job-917507-jobServer-917507-5:Execute SQL Query on Sybase Database Server - no driver(P268247000.F268251000.E268252000):Execute SQL Query on Sybase Database Server] ERROR (com.nolio.platform.shared.datamodel.Action:221) - <u> An error occurred during database connection establishment</u><br/><b>Failed to initialize driver: com.sybase.jdbc3.jdbc.SybDriver<br>com.sybase.jdbc3.jdbc.SybDriver</b><br/>error code: 0
java.sql.SQLException: Failed to initialize driver: com.sybase.jdbc3.jdbc.SybDriver
    at com.nolio.platform.shared.util.db.DBConnectionFactory.getSybaseSQLConnection(DBConnectionFactory.java:218)
    at com.nolio.platform.shared.executables.actions.ExecuteSybaseSQL.createConnection(ExecuteSybaseSQL.java:34)
    at com.nolio.platform.shared.executables.actions.ExecuteSQL.execute(ExecuteSQL.java:212)
    at com.nolio.platform.shared.datamodel.ActionExecutionState.localExecution(ActionExecutionState.java:385)
    at com.nolio.platform.shared.datamodel.ActionExecutionState.access$500(ActionExecutionState.java:46)
    at com.nolio.platform.shared.datamodel.ActionExecutionState$2.execAction(ActionExecutionState.java:132)
    at com.nolio.platform.shared.datamodel.ActionExecutionState.exec(ActionExecutionState.java:402)
    at com.nolio.platform.shared.datamodel.Action.run(Action.java:229)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at com.nolio.platform.shared.flowcontrol.LocalFlowController$JobBoundThreadFactory$1.run(LocalFlowController.java:804)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: com.sybase.jdbc3.jdbc.SybDriver
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at com.nolio.platform.shared.util.db.DBConnectionFactory.getSybaseSQLConnection(DBConnectionFactory.java:213)
    ... 13 more

Cause

The action above was running without specifying any value in the "Driver Class Name [String]" field. By default the action will attempt to use the driver class name: com.symbase.jdbc3.jdbc.SybDriver 

However, the jar file that makes this driver class available is not shipped with CA Release Automation.

Environment

CA Release Automation v6.6

Resolution

There are at least two ways to go about solving this problem.
  1. Import the jar file that supplies this driver class.
  2. Use an alternative driver. To do this:
    1. Import the jar file that offers an alternative, Sybase compatible, driver. 
    2. In the action there is a "Driver Class Name [String]" field. Specify the driver class name for the alternative driver you'll be using to connect to Sybase. 

Additional Information

At the time of this writing it looks like com.sybase.jdbc3.jdbc.SybDriver is used by the jconn3.jar file. The official source for this jar file is not clear. However, it looks like there is also a jconn4.jar discussed here on Sybase's site: http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc01776.1604/doc/html/san1357754912881.html

At the time of this writing it looks like jtds-1.3.1.jar offers a compatible Sybase driver that uses the driver class name: net.sourceforge.jtds.jdbc.Driver