chunjun icon indicating copy to clipboard operation
chunjun copied to clipboard

[Bug] [SqlserverDynamicTableFactory.java ] there is a bug in getDialect function, this function will init driver with Microsoft JDBC driver.

Open yanqiw opened this issue 2 years ago • 2 comments

Search before asking

  • [X] I had searched in the issues and found no similar issues.

What happened

I am using sql job to get data from sqlserver. After config the job, I got error "No suitable driver found for jdbc:jtds:sqlserve".

After checking the init way of sqlserver-x, I found the getDialect function with some bugs.

    @Override
    protected JdbcDialect getDialect() {
        return new SqlserverDialect(); 
    }

What you expected to happen

this function should init SqlserverDialect with jtds driver base on config. for example:

       new SqlserverDialect(
                        jdbcConf.isWithNoLock(),
                        jdbcConf.getJdbcUrl().startsWith("jdbc:jtds:sqlserver"));

How to reproduce

just use a sql config for sqlserver

Anything else

No response

Version

1.12_release

Are you willing to submit PR?

  • [X] Yes I am willing to submit a PR!

Code of Conduct

yanqiw avatar Jul 24 '22 06:07 yanqiw

Hi, sorry for reply so long. I think is nice to do this, can you provide a pr for this?

FlechazoW avatar Jul 26 '22 09:07 FlechazoW

sure, I will submit a pr for this

yanqiw avatar Jul 31 '22 03:07 yanqiw