0

I'm using Hibernate to connect to Exasol Database using Exasol Hibernate Dialect. When I use the following persistence.xml, everything works fine:

  <persistence-unit name="exasol">
    <description>exasol</description>
    <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
    <properties>
      <property name="javax.persistence.jdbc.driver" value="com.exasol.jdbc.EXADriver" />
      <property name="javax.persistence.jdbc.url" value="jdbc:exa:192.168.6.11:8563" />
      <property name="javax.persistence.jdbc.user" value="user" />
      <property name="javax.persistence.jdbc.password" value="pass" />
      <property name="hibernate.dialect" value="com.incuda.config.ExasolDialect"/>
      <property name="hibernate.default_schema" value="my_schema" />
    </properties>
  </persistence-unit>

But now I don't want to use the following property for some internal reasons (e.g this reason):

  <property name="hibernate.default_schema" value="my_schema" />

and replace it by incorporating schema name inside connection string URL, like the one suggested in EXASolution User Manual, page 349 (download URL):

<property name="javax.persistence.jdbc.url" value="jdbc:exa:192.168.6.11:8563;schema=my_schema" />

But when I do so, I get the following exception:

Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at java.lang.String.substring(String.java:1967)
    at com.incuda.config.ExasolIdentityColumnSupport.getIdentitySelectString(ExasolIdentityColumnSupport.java:25)

So, what is the correct way of incorporating schema name into Exasol connection string URL?

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
gdrt
  • 3,160
  • 4
  • 37
  • 56
  • why do you need the schema? If you have the schema before all your tables, views, and script it shouldn't be a problem. Also you can run a `OPEN SCHEMA my_schema;` command when you open the connection – mucio Feb 28 '18 at 08:36
  • This is interesting, I'll take a look at that. – gdrt Feb 28 '18 at 09:13

0 Answers0