Open wingsofdragon opened 2 weeks ago
Driver version used:
What is your SQL Server connection URL?
What is your SQL Server connection URL? In ShardingSphere-Proxy: url: jdbc:sqlserver://127.0.0.1:1433;databasename=mydatabase In my project: url: jdbc:sqlserver://127.0.0.1:3307;databasename=sharding_db
Note: When I switch the data source to mysql, it works fine.
What's mean URL in ShardingSphere-Proxy or URL in your project?
What's mean URL in ShardingSphere-Proxy or URL in your project?
I misunderstood, let's put this aside, the URL for ShardingSphere-Proxy is: jdbc:sqlserver://127.0.0.1:1433;databasename=mydatabase
Can you provide an example to reproduce it?
https://shardingsphere.apache.org/document/current/en/overview/ The official website states that SQLserver is not currently supported by ShardingSphere-Proxy. @terrymanu I appreciate your patient answer.
In the configuration of dataSources, SQLServer connection requires "url" to be in strict format: jdbc:(microsoft:)?sqlserver://([\w-.]+):?(\d);\S(DatabaseName|database)=([\w-.]+);?, otherwise it cannot be recognized. However, the "url" that meets the requirements will throw a NumberFormatException in (StandardJdbcUrlParser.java:76). After changing AUTHORITY_PATTERN = "(?://(?[^/?#]))?\s"
to AUTHORITY_PATTERN = "(?://(?[^/?#;]))?\s",
it can be started normally.
However, ShardingSphere-Proxy cannot be used normally, and an error is reported after connection:
create connection SQLException, url: jdbc:sqlserver://127.0.0.1:3307;databasename=sharding_db, errorCode 0, state 08S01.
Error: "The driver received an unexpected pre-login response. Verify the connection properties and check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. This driver can be used only with SQL Server 2005 or later."