title: Oracle 19c jdbc driver doesn't support schema names bigger than 30 bytes
body: <p>According to Oracle's 19c <a href="https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/Database-Object-Names-and-Qualifiers.html#GUID-75337742-67FD-4EC0-985F-741C93D918DA" rel="nofollow noreferrer">documentation</a>:</p>
  <blockquote>
  <p>The schema name can be 128 bytes, the table name can be 128 bytes, and the column name can be 128 bytes.</p>
  </blockquote>
  <p>However, I'm facing this issue whenever I try to use a schema name bigger than 30 bytes:</p>
  <pre><code>Caused by: java.sql.SQLException: Invalid argument(s) in call
  at oracle.jdbc.driver.PhysicalConnection.setSchema(PhysicalConnection.java:9462)
  at com.zaxxer.hikari.pool.ProxyConnection.setSchema(ProxyConnection.java:460)
  at com.zaxxer.hikari.pool.HikariProxyConnection.setSchema(HikariProxyConnection.java)
  </code></pre>
  <p>The driver used is:</p>
  <pre class="lang-xml prettyprint-override"><code>        &lt;dependency&gt;
              &lt;groupId&gt;com.oracle.database.jdbc&lt;/groupId&gt;
              &lt;artifactId&gt;ojdbc8&lt;/artifactId&gt;
              &lt;version&gt;19.7.0.0&lt;/version&gt;
          &lt;/dependency&gt;
  </code></pre>
  <p>It looks like the driver is not supporting longer object names introduced as per 12c version, any clues if this is somehow configurable? Could it also perhaps be some AWS RDS specific issue?</p>
  <p>On SQL Developer using same jdbc url:</p>
  <pre><code>SELECT name, value FROM v$parameter WHERE name = 'compatible';
  
  NAME       | VALUE
  -------------------
  compatible | 19.0.0
  
  ALTER SESSION SET CURRENT_SCHEMA = VERY_VERY_VERY_LONG_SCHEMA_NAME;
  
  Session altered.
  </code></pre>
  <p><strong>UPDATE:</strong>
  After decompiling the driver code this is what I see:</p>
  <pre><code>public void setSchema(String schema) throws SQLException {
      try {
          String quoted = &quot;\&quot;[^\u0000\&quot;]{0,28}\&quot;&quot;;
          String unquoted = &quot;(\\p{javaLowerCase}|\\p{javaUpperCase})(\\p{javaLowerCase}|\\p{javaUpperCase}|\\d|_|\\$|#){0,29}&quot;;
          String idPat = &quot;(&quot; + quoted + &quot;)|(&quot; + unquoted + &quot;)&quot;;
          SQLException var10000;
          SQLException var9;
          if (schema == null) {
              var10000 = var9 = (SQLException)((SQLException)DatabaseError.createSqlException(this.getConnectionDuringExceptionHandling(), 68).fillInStackTrace());
              throw var10000;
          } else if (!schema.matches(idPat)) {
              var10000 = var9 = (SQLException)((SQLException)DatabaseError.createSqlException(this.getConnectionDuringExceptionHandling(), 68).fillInStackTrace());
              throw var10000;
          } else {
              String sql = &quot;alter session set current_schema = &quot; + schema;
              Statement stmt = null;
              try {
                  stmt = this.createStatement();
                  stmt.execute(sql);
      ...
  }
  </code></pre>
  <p>Meaning that the driver is hardcoded to accept only 30 chars. So it seems to be a <strong>bug in the Oracle JDBC driver</strong> implementation. Any ideas for alternatives?</p>