DTStack / DTStack/chunjun

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

Open
#1,087 2 comments 0 reactions 1 assignee Claimed by @yanqiw View on GitHub
bug good first issue
Dominant language
Java
Stars
4.1k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

### Search before asking

- [X] I had searched in the [issues](https://github.com/DTStack/chunjun/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.

```java
@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:
```java
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

- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.