Search code examples
javajdbcweblogicweblogic12c

Which is the sybase driver(version) to be used in Weblogic 12c ? Where should I add the downloaded driver?


I am migrating my application from Weblogic 9 to 12c.

The connection pool - cvSybasepool created for my application is working fine on Web logic 9.
I had used com.sybase.jdbc.SybDriver to connect to Sybase database on Weblogic 9.

After replicating the connection pool(cvSybasepool) on Weblogic 12c, I get the following error:

<Jun 21, 2016 4:40:25 AM EDT> <Error> <Deployer> <BEA-149205> <Failed to initialize the application "cvSybasepool" due to error weblogic.application.ModuleException: weblogic.com
mon.resourcepool.ResourceSystemException: Cannot load driver class com.sybase.jdbc.SybDriver for datasource 'cvSybasepool'.
weblogic.application.ModuleException: weblogic.common.resourcepool.ResourceSystemException: Cannot load driver class com.sybase.jdbc.SybDriver for datasource 'cvSybasepool'.
        at weblogic.jdbc.module.JDBCModule.prepare(JDBCModule.java:350)
        at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:100)
        at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:175)
        at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:170)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)
        Truncated. see log file for complete stacktrace
Caused By: weblogic.common.resourcepool.ResourceSystemException: Cannot load driver class com.sybase.jdbc.SybDriver for datasource 'cvSybasepool'.
        at weblogic.jdbc.common.internal.JDBCUtil.parseException(JDBCUtil.java:322)
        at weblogic.jdbc.common.internal.ConnectionEnvFactory.loadDriver(ConnectionEnvFactory.java:82)
        at weblogic.jdbc.common.internal.ConnectionEnvFactory.<init>(ConnectionEnvFactory.java:141)
        at weblogic.jdbc.common.internal.ConnectionPool.initPooledResourceFactory(ConnectionPool.java:1110)
        at weblogic.common.resourcepool.ResourcePoolImpl.start(ResourcePoolImpl.java:226)
        Truncated. see log file for complete stacktrace
>

I suspect the Sybase JDBC driver jar is missing on Web logic 12c.

Also, When the Sybase driver provided by Web logic server is used, I get the following error

FILogger.log(232) - java.sql.SQLException: [FMWGEN][Sybase JDBC Driver][Sybase]A USE DATABASE statement is not allowed in a procedure or trigger. at weblogic.jdbc.sybasebase.ddcn.b(Unknown Source) at weblogic.jdbc.sybasebase.ddcn.a(Unknown Source) at weblogic.jdbc.sybasebase.ddcm.b(Unknown Source) at weblogic.jdbc.sybasebase.ddcm.a(Unknown Source) 
  1. Which driver needs to be used to connect to Sybase DB on Weblogic 12c? Jconn2.jar/Jconn3.jar?
  2. Which jar needs to be added to Weblogic server?
  3. Where do I need to add the jar and what configuration has be done?

Solution

  • I finally resolved the issue.

    I could not use the sybase driver(weblogic.jdbc.sybase.SybaseDriver) bundled with weblogic as it was not complaint with my SQL code

    Below are steps I followed.

    1. Downloaded & copied JDBC driver JAR - jConnect.jar to ${WL_HOME}/server/lib/

    2. Updated the setDomainEnv.cmd script in my domain's bin directory, and prepended the JAR file to the PRE_CLASSPATH environment variable(If the newly added JDBC driver JAR is required in other domains, then edit the commEnv.cmd/sh script in WL_HOME/common/bin and prepend your JAR file to the WEBLOGIC_CLASSPATH environment variable.)

    3. Restarted the server.