Magnus Mogren created CALCITE-6675:
--------------------------------------

             Summary: JDBC adapter does not work for SQL server if connection 
string contains semicolon
                 Key: CALCITE-6675
                 URL: https://issues.apache.org/jira/browse/CALCITE-6675
             Project: Calcite
          Issue Type: Bug
          Components: jdbc-adapter
    Affects Versions: 1.38.0
            Reporter: Magnus Mogren


For SQL server the connection URL contains semicolon.

If im using an inline model and passes that to DriverManager.getConnection then 
the class org.apache.calcite.avatica.ConnectStringParser will destroy the model 
since it uses semicolon as a delimiter.

 

*Inline model connection string:*
{code:java}
jdbc:calcite:model=inline:{
  version: '1.0',
  defaultSchema: 'TheSchema',
  schemas: [
    {
      name: 'TheSchema',
      type: 'custom',
      factory: 'org.apache.calcite.adapter.jdbc.JdbcSchema$Factory',
      operand: {
        jdbcDriver: 'com.microsoft.sqlserver.jdbc.SQLServerDriver',
        jdbcUrl: 
'jdbc:sqlserver://theserver:1433;databaseName=thedbname;encrypt=true;',
        jdbcUser: 'theuser',
        jdbcPassword: 'thepassword'
      }
    }
  ]
} {code}
The result is an error like this 
{noformat}
Unexpected end-of-input: was expecting closing quote for a string value
 at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` 
disabled); line: someline, column: somecolumn] (through reference chain: 
org.apache.calcite.model.JsonRoot["schemas"]->java.util.ArrayList[1]->org.apache.calcite.model.JsonCustomSchema["operand"]){noformat}
 

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to