title: Both Oracle and Sybase Kerberos Authentication using Hikari Datasource in Spring Boot
body: <p>In my spring boot application I am using two databases Oracle and Sybase and connecting the database using Kerberos. When I kerberised one of them at a time it worked good, but when I try to use both of them at the same time I'm getting an exception.</p>
  <p>My datasource for both the database in <code>.yml</code> file are as:</p>
  <pre><code>database:
  oracleDatasource:
  DriverclassNqme:*oracle Driver*
  JdbcUrl: JdbcUrl
  data-source-properties:
   oracle.net.kerberos5_cc_name:*location of cache File*
   oracle.net.authentication_services: (KERBEROS5)
   oracle.net.kerberos5_mutual_authentication: true
  
  sybaseDataSource:
  driverClassName: com.sybase.jdbc4.jdbc.SybDriver
  jdbcUrl: SyabaseDataBaseUrl
  data-source-properties:
   REQUEST_KERBEROS_SESSION: true
   SERVICE_PRINCIPLE_NAME: principlename
  </code></pre>
  <p>and I am having one <code>jass.conf</code> file for the Sybase</p>
  <pre><code>com.sun.security.jggs.initiate{
  com.sun.security.auth.module.Krb5LoginModule required
  useTicketCache=true
  ticketCache=&quot;path of my sybasecache File&quot;
  };
  </code></pre>
  <p>When I run the my application with below VM argument ,</p>
  <pre><code>-Djava.security.krb5.conf=&quot;path of my conf file&quot;
  -Djava.security.auth.login.config=&quot;path of my jass.conf file&quot;
  -Djavax.security.auth.useSubjectCredsOnly=false
  </code></pre>
  <p>at the time I getting the below exception for Oracle datasource</p>
  <pre><code>Caused by:com.zaxerr.hikari.pool.HikariPool$InitializationException:Failed to initialize the pool:EncryptionKey:Key byte can not be null
  </code></pre>
  <p>and when I removed the <code>-Djavax.security.auth.useSubjectCredsOnly=false</code> from argument at that time getting the below exception for SybaseDataSource,</p>
  <pre><code>ERROR IdTableHelper unable to obtain jdbc Connection
  java.sql.SQLException:JZ006:caught IOException:java.net.ConnectException:Connection timed out&quot;
  </code></pre>
  <p>Can any one help me out how to fix this or how can I use the Kerberos cache file in datasource properties for the Sybase same like Oracle.
  Any help suggestion must be appreciated. Thanks in Advance.</p>