title: Springboot with Sybase server - Cannot load driver class: com.sybase.jdbc4.jdbc.SybDriver
body: <p>Facing difficulty in configuring Sybase server with a fresh Spring boot application. Not sure how to configure Sybase server with spring boot successfully. Getting error "Cannot load driver class: com.sybase.jdbc4.jdbc.SybDriver".</p>
  
  <p>Basically, I am looking to fetch some data from Sybase database and post as RESTful service in JSON format. Any help would be appreciated. </p>
  
  <p>pom.xml</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;com.rbccm.poc&lt;/groupId&gt;
      &lt;artifactId&gt;springbootpoc1&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
  
      &lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;2.0.0.RELEASE&lt;/version&gt;
      &lt;/parent&gt;
  
      &lt;name&gt;springbootpoc1&lt;/name&gt;
      &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;com.sybase.jconnect&lt;/groupId&gt;
              &lt;artifactId&gt;jconn4&lt;/artifactId&gt;
              &lt;version&gt;7.07&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;com.github.derjust&lt;/groupId&gt;
              &lt;artifactId&gt;spring-data-dynamodb&lt;/artifactId&gt;
              &lt;version&gt;5.0.2&lt;/version&gt;
          &lt;/dependency&gt;
  
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>application.properties</p>
  
  <pre><code>server.port=8090
  
  spring.jpa.hibernate.ddl-auto=none
  spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
  spring.jpa.databasePlatform=org.hibernate.dialect.SybaseDialect
  spring.jpa.show-sql=true
  
  # hikariCP
  spring.datasource.type=com.zaxxer.hikari.HikariDataSource
  spring.datasource.url=jdbc:sybase:Tds:server:port/dbname
  spring.datasource.username=u_****
  spring.datasource.password=****
  spring.datasource.connectionTestQuery=SELECT 1
  spring.datasource.poolName=SpringBootHikariCP
  spring.datasource.maximumPoolSize=10
  spring.datasource.connectionTimeout=60000
  spring.datasource.driverClassName=com.sybase.jdbc4.jdbc.SybDriver
  
  # Number of ms to wait before throwing an exception if no connection is available.
  spring.datasource.tomcat.max-wait=10000
  # Maximum number of active connections that can be allocated from this pool at the same time.
  spring.datasource.tomcat.max-active=50
  # Validate the connection before borrowing it from the pool.
  spring.datasource.tomcat.test-on-borrow=true
  
  #JDBC customize
  spring.jdbc.template.max-rows=500
  </code></pre>
  
  <p>Maven build logs</p>
  
  <pre><code>2018-04-04 14:48:25.206 ERROR 21768 --- [           main] o.s.boot.SpringApplication               : Application run failed
  
  org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is java.lang.IllegalStateException: Cannot load driver class: com.sybase.jdbc4.jdbc.SybDriver
      at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:729) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
      at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:192) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
  </code></pre>