Error while connecting with MSSQL server

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Error while connecting with MSSQL server

anuj.aj07
Hello ,

I am trying to create a table with microsoft sql server  using flink sql

CREATE TABLE sampleSQLSink (
    id INTEGER
    message STRING,    
    ts TIMESTAMP(3),
    proctime AS PROCTIME() 
) WITH (
    'connector' = 'jdbc',  
    'driver' = 'com.microsoft.sqlserver.jdbc.SQLServerDriver',      
    'url' = 'jdbc:sqlserver://samplecustsql.database.windows.net:1433;database=customerdb',
    'username'= 
    'password'= 
    'table-name' = 
);


select * from sampleSQLSink


I am getting this error 

ERROR] Could not execute SQL statement. Reason:
java.lang.IllegalStateException: Cannot handle such jdbc url: jdbc:sqlserver://samplecustsql.database.windows.net:1433;database=customerdb


Can somedoby help what is wrong.

I am using microsoft jdbc driver.
Reply | Threaded
Open this post in threaded view
|

Re: Error while connecting with MSSQL server

Jark Wu-3
Hi,

Currently, flink-connector-jdbc doesn't support MS Server dialect. Only MySQL and Postgres are supported. 

Best,
Jark

On Tue, 8 Dec 2020 at 01:20, aj <[hidden email]> wrote:
Hello ,

I am trying to create a table with microsoft sql server  using flink sql

CREATE TABLE sampleSQLSink (
    id INTEGER
    message STRING,    
    ts TIMESTAMP(3),
    proctime AS PROCTIME() 
) WITH (
    'connector' = 'jdbc',  
    'driver' = 'com.microsoft.sqlserver.jdbc.SQLServerDriver',      
    'url' = 'jdbc:sqlserver://samplecustsql.database.windows.net:1433;database=customerdb',
    'username'= 
    'password'= 
    'table-name' = 
);


select * from sampleSQLSink


I am getting this error 

ERROR] Could not execute SQL statement. Reason:
java.lang.IllegalStateException: Cannot handle such jdbc url: jdbc:sqlserver://samplecustsql.database.windows.net:1433;database=customerdb


Can somedoby help what is wrong.

I am using microsoft jdbc driver.
Reply | Threaded
Open this post in threaded view
|

Re: Error while connecting with MSSQL server

Flavio Pompermaier
I issued a PR some time ago at https://github.com/apache/flink/pull/12038 but Flink committers were busy in refactoring that part..I don't know if it is still required to have that part into the jdbc connector Flink code of if using the new factories (that use the java services) you could register your own dialect putting your code in a separate jar

On Tue, Dec 8, 2020 at 7:02 AM Jark Wu <[hidden email]> wrote:
Hi,

Currently, flink-connector-jdbc doesn't support MS Server dialect. Only MySQL and Postgres are supported. 

Best,
Jark

On Tue, 8 Dec 2020 at 01:20, aj <[hidden email]> wrote:
Hello ,

I am trying to create a table with microsoft sql server  using flink sql

CREATE TABLE sampleSQLSink (
    id INTEGER
    message STRING,    
    ts TIMESTAMP(3),
    proctime AS PROCTIME() 
) WITH (
    'connector' = 'jdbc',  
    'driver' = 'com.microsoft.sqlserver.jdbc.SQLServerDriver',      
    'url' = 'jdbc:sqlserver://samplecustsql.database.windows.net:1433;database=customerdb',
    'username'= 
    'password'= 
    'table-name' = 
);


select * from sampleSQLSink


I am getting this error 

ERROR] Could not execute SQL statement. Reason:
java.lang.IllegalStateException: Cannot handle such jdbc url: jdbc:sqlserver://samplecustsql.database.windows.net:1433;database=customerdb


Can somedoby help what is wrong.

I am using microsoft jdbc driver.
Reply | Threaded
Open this post in threaded view
|

Re: Error while connecting with MSSQL server

anuj.aj07
Sure thanks Flavio, will check it out

On Wed, Dec 9, 2020, 16:20 Flavio Pompermaier <[hidden email]> wrote:
I issued a PR some time ago at https://github.com/apache/flink/pull/12038 but Flink committers were busy in refactoring that part..I don't know if it is still required to have that part into the jdbc connector Flink code of if using the new factories (that use the java services) you could register your own dialect putting your code in a separate jar

On Tue, Dec 8, 2020 at 7:02 AM Jark Wu <[hidden email]> wrote:
Hi,

Currently, flink-connector-jdbc doesn't support MS Server dialect. Only MySQL and Postgres are supported. 

Best,
Jark

On Tue, 8 Dec 2020 at 01:20, aj <[hidden email]> wrote:
Hello ,

I am trying to create a table with microsoft sql server  using flink sql

CREATE TABLE sampleSQLSink (
    id INTEGER
    message STRING,    
    ts TIMESTAMP(3),
    proctime AS PROCTIME() 
) WITH (
    'connector' = 'jdbc',  
    'driver' = 'com.microsoft.sqlserver.jdbc.SQLServerDriver',      
    'url' = 'jdbc:sqlserver://samplecustsql.database.windows.net:1433;database=customerdb',
    'username'= 
    'password'= 
    'table-name' = 
);


select * from sampleSQLSink


I am getting this error 

ERROR] Could not execute SQL statement. Reason:
java.lang.IllegalStateException: Cannot handle such jdbc url: jdbc:sqlserver://samplecustsql.database.windows.net:1433;database=customerdb


Can somedoby help what is wrong.

I am using microsoft jdbc driver.