✨ [Feature] SqlServer Versions
Contribution guidelines
- [X] I've read the contribution guidelines and wholeheartedly agree
I want to suggest an idea and checked that ...
- [ ] ... to my best knowledge, my idea wouldn't break something for other users
- [ ] ... the documentation does not mention anything about my idea
- [ ] ... there are no open or closed issues that are related to my idea
Description
也许你的SqlServer连接可能是对的,默认使用JdbcConnection#formatJdbcUrl 生成的通用的连接
但是我在测试的时候使用SqlServer版本是2017
必须要重写 JdbcConnection#formatJdbcUrl 方法才能使用。
Use Cases
重写代码如下:
protected String formatJdbcUrl() {
JdbcConfigure jdbcConfigure = (JdbcConfigure) this.getConfigure();
StringBuffer buffer = new StringBuffer();
buffer.append("jdbc:");
buffer.append(jdbcConfigure.getJdbcType());
buffer.append("://");
buffer.append(jdbcConfigure.getHost());
buffer.append(":");
buffer.append(jdbcConfigure.getPort());
buffer.append(";");
if (jdbcConfigure.getDatabase().isPresent()) {
buffer.append("databaseName=");
buffer.append(jdbcConfigure.getDatabase().get());
buffer.append(";");
}
if (jdbcConfigure.getSsl().isPresent()) {
buffer.append(String.format("ssl=%s", jdbcConfigure.getSsl().get()));
buffer.append(";");
}
if (jdbcConfigure.getEnv().isPresent()) {
Map<String, Object> env = jdbcConfigure.getEnv().get();
List
附上使用的SqlSever镜像,docker-compose.yml version: '3.3' services: sqlserver: image: microsoft/mssql-server-linux container_name: mssql-server restart: always environment: - ACCEPT_EULA=Y - SA_PASSWORD=TestH2023 ports: - 1433:1433 volumes: - ./mssql:/var/opt/mssql
Screenshots / Mockups
No response