java当中JDBC当中请给出一个SQLServer DataSource and SingleTon例子

本文介绍了一种使用JDBC驱动实现SQL Server单例数据源的方法,通过Singleton模式确保了在整个应用程序中数据源的唯一性,提高了资源利用效率。文章提供了完整的代码示例,包括数据源的初始化和获取连接的过程,并通过测试程序验证了单例模式的有效性。

5.SQLServer DataSource and SingleTon:


import net.sourceforge.jtds.jdbcx.*;
import java.sql.*;
import javax.sql.*;

public class SqlserverSingletonDataSource {
static private JtdsDataSource ds;
private Connection con;
private SqlserverSingletonDataSource() {

try {
ds = new JtdsDataSource();
ds.setServerName("localhost");
ds.setDatabaseName("pubs");
ds.setUser("sa");
ds.setPassword("");
}
catch (Exception e) {
}
}

public static Connection getConnection() throws Exception {
if (ds == null) {
new SqlserverSingletonDataSource();
}
Connection con =null;
try {
con = ds.getConnection();
} catch (SQLException ex) {
}

return con;
}
}


 

测试程序:



/*when you use single step to debug the program, you can find that Singleton only
is executed once.*/
import java.sql.*;
import javax.sql.*;

public class testSqlserverSingletonDataSource {

public static void main(String args[]) {
Connection con;

try {
con = SqlserverSingletonDataSource.getConnection();
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from authors");
while (rs.next()) {
System.out.print(rs.getString("au_id") + " ");
System.out.println(rs.getString("au_lname"));
}

}
catch (Exception e) {
}

System.out.println("the following is the second time ");

try {
con = SqlserverSingletonDataSource.getConnection();
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from authors");
while (rs.next()) {
System.out.print(rs.getString("au_id") + " ");
System.out.println(rs.getString("au_lname"));
}

}
catch (Exception e) {
}

}

}

更多请看下节:https://blog.youkuaiyun.com/qq_43650923/article/details/100655993

 

=================================== 2025-09-15 14:15:40.006 [scheduling-1] DEBUG o.s.data.redis.core.RedisConnectionUtils - Fetching Redis Connection from RedisConnectionFactory 2025-09-15 14:15:40.007 [scheduling-1] DEBUG io.lettuce.core.RedisChannelHandler - dispatching command AsyncCommand [type=GET, output=ValueOutput [output=null, error='null'], commandType=io.lettuce.core.protocol.Command] 2025-09-15 14:15:40.007 [scheduling-1] DEBUG io.lettuce.core.protocol.DefaultEndpoint - [channel=0x0923a51f, /127.0.0.1:19257 -> localhost/127.0.0.1:6379, epid=0x1] write() writeAndFlush command AsyncCommand [type=GET, output=ValueOutput [output=null, error='null'], commandType=io.lettuce.core.protocol.Command] 2025-09-15 14:15:40.007 [lettuce-nioEventLoop-5-1] DEBUG io.lettuce.core.protocol.CommandHandler - [channel=0x0923a51f, /127.0.0.1:19257 -> localhost/127.0.0.1:6379, epid=0x1, chid=0x1] write(ctx, AsyncCommand [type=GET, output=ValueOutput [output=null, error='null'], commandType=io.lettuce.core.protocol.Command], promise) 2025-09-15 14:15:40.008 [scheduling-1] DEBUG io.lettuce.core.protocol.DefaultEndpoint - [channel=0x0923a51f, /127.0.0.1:19257 -> localhost/127.0.0.1:6379, epid=0x1] write() done 2025-09-15 14:15:40.008 [lettuce-nioEventLoop-5-1] DEBUG io.lettuce.core.protocol.CommandEncoder - [channel=0x0923a51f, /127.0.0.1:19257 -> localhost/127.0.0.1:6379] writing command AsyncCommand [type=GET, output=ValueOutput [output=null, error='null'], commandType=io.lettuce.core.protocol.Command] 2025-09-15 14:15:40.009 [lettuce-nioEventLoop-5-1] DEBUG io.lettuce.core.protocol.CommandHandler - [channel=0x0923a51f, /127.0.0.1:19257 -> localhost/127.0.0.1:6379, epid=0x1, chid=0x1] Received: 5 bytes, 1 commands in the stack 2025-09-15 14:15:40.009 [lettuce-nioEventLoop-5-1] DEBUG io.lettuce.core.protocol.CommandHandler - [channel=0x0923a51f, /127.0.0.1:19257 -> localhost/127.0.0.1:6379, epid=0x1, chid=0x1] Stack contains: 1 commands 2025-09-15 14:15:40.009 [lettuce-nioEventLoop-5-1] DEBUG io.lettuce.core.protocol.RedisStateMachine - Decode done, empty stack: true 2025-09-15 14:15:40.009 [lettuce-nioEventLoop-5-1] DEBUG io.lettuce.core.protocol.CommandHandler - [channel=0x0923a51f, /127.0.0.1:19257 -> localhost/127.0.0.1:6379, epid=0x1, chid=0x1] Completing command LatencyMeteredCommand [type=GET, output=ValueOutput [output=null, error='null'], commandType=io.lettuce.core.protocol.AsyncCommand] 2025-09-15 14:15:40.010 [scheduling-1] DEBUG o.s.data.redis.core.RedisConnectionUtils - Closing Redis Connection. xx = null 2025-09-15 14:15:40.025 [reactor-http-nio-3] DEBUG reactor.netty.http.server.HttpServerOperations - [e7d590bf, L:/0:0:0:0:0:0:0:1:9000 - R:/0:0:0:0:0:0:0:1:19306] New http connection, requesting read 2025-09-15 14:15:40.025 [reactor-http-nio-2] DEBUG reactor.netty.http.server.HttpServerOperations - [5aba2990, L:/0:0:0:0:0:0:0:1:9000 - R:/0:0:0:0:0:0:0:1:19305] New http connection, requesting read 2025-09-15 14:15:40.025 [reactor-http-nio-3] DEBUG reactor.netty.transport.TransportConfig - [e7d590bf, L:/0:0:0:0:0:0:0:1:9000 - R:/0:0:0:0:0:0:0:1:19306] Initialized pipeline DefaultChannelPipeline{(reactor.left.httpCodec = io.netty.handler.codec.http.HttpServerCodec), (reactor.left.httpTrafficHandler = reactor.netty.http.server.HttpTrafficHandler), (reactor.right.reactiveBridge = reactor.netty.channel.ChannelOperationsHandler)} 2025-09-15 14:15:40.025 [reactor-http-nio-2] DEBUG reactor.netty.transport.TransportConfig - [5aba2990, L:/0:0:0:0:0:0:0:1:9000 - R:/0:0:0:0:0:0:0:1:19305] Initialized pipeline DefaultChannelPipeline{(reactor.left.httpCodec = io.netty.handler.codec.http.HttpServerCodec), (reactor.left.httpTrafficHandler = reactor.netty.http.server.HttpTrafficHandler), (reactor.right.reactiveBridge = reactor.netty.channel.ChannelOperationsHandler)} 2025-09-15 14:15:40.047 [reactor-http-nio-3] DEBUG reactor.netty.http.server.HttpServerOperations - [e7d590bf, L:/0:0:0:0:0:0:0:1:9000 - R:/0:0:0:0:0:0:0:1:19306] Increasing pending responses, now 1 2025-09-15 14:15:40.063 [reactor-http-nio-3] DEBUG reactor.netty.http.server.HttpServer - [e7d590bf-1, L:/0:0:0:0:0:0:0:1:9000 - R:/0:0:0:0:0:0:0:1:19306] Handler is being applied: org.springframework.http.server.reactive.ReactorHttpHandlerAdapter@624c2589 2025-09-15 14:15:40.092 [reactor-http-nio-3] DEBUG o.s.web.server.adapter.HttpWebHandlerAdapter - [e7d590bf-1] HTTP GET "/factory/query?pageIndex=1&pageSize=10" 2025-09-15 14:15:40.124 [reactor-http-nio-3] DEBUG o.s.w.r.r.m.a.RequestMappingHandlerMapping - [e7d590bf-1] Mapped to com.hvlink.controller.FactoryController#getFactory(FactoryDTO, BasePageParam) 2025-09-15 14:15:40.188 [reactor-http-nio-3] DEBUG org.mybatis.spring.SqlSessionUtils - Creating a new SqlSession 2025-09-15 14:15:40.196 [reactor-http-nio-3] DEBUG org.mybatis.spring.SqlSessionUtils - SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@5a08cbdc] was not registered for synchronization because synchronization is not active 2025-09-15 14:15:40.356 [reactor-http-nio-3] DEBUG o.springframework.jdbc.datasource.DataSourceUtils - Fetching JDBC Connection from DataSource 2025-09-15 14:15:40.551 [reactor-http-nio-3] INFO com.alibaba.druid.pool.DruidDataSource - {dataSource-1} inited 2025-09-15 14:15:41.016 [reactor-http-nio-3] DEBUG o.m.spring.transaction.SpringManagedTransaction - JDBC Connection [ConnectionID:1 ClientConnectionId: bb5bf1d4-b1d2-4437-9e0f-80e7d4cc69a6] will not be managed by Spring 2025-09-15 14:15:41.020 [reactor-http-nio-3] DEBUG com.hvlink.mapper.FactoryMapper.getFactory_mpCount - ==> Preparing: SELECT COUNT(*) AS total FROM tm_factory 2025-09-15 14:15:41.045 [reactor-http-nio-3] DEBUG com.hvlink.mapper.FactoryMapper.getFactory_mpCount - ==> Parameters: 2025-09-15 14:15:41.078 [reactor-http-nio-3] DEBUG com.hvlink.mapper.FactoryMapper.getFactory_mpCount - <== Total: 1 2025-09-15 14:15:41.088 [reactor-http-nio-3] DEBUG com.hvlink.mapper.FactoryMapper.getFactory - ==> Preparing: SELECT factory_code,factory_name,status FROM tm_factory OFFSET ? ROWS FETCH NEXT ? ROWS ONLY 2025-09-15 14:15:41.093 [reactor-http-nio-3] DEBUG com.hvlink.mapper.FactoryMapper.getFactory - ==> Parameters: 0(Long), 10(Long) 2025-09-15 14:15:41.113 [reactor-http-nio-3] DEBUG org.mybatis.spring.SqlSessionUtils - Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@5a08cbdc] 2025-09-15 14:15:41.153 [reactor-http-nio-3] DEBUG o.s.beans.factory.xml.XmlBeanDefinitionReader - Loaded 11 bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml] 2025-09-15 14:15:41.154 [reactor-http-nio-3] DEBUG o.s.b.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'DB2' 2025-09-15 14:15:41.159 [reactor-http-nio-3] DEBUG o.s.b.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'Derby' 2025-09-15 14:15:41.159 [reactor-http-nio-3] DEBUG o.s.b.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'H2' 2025-09-15 14:15:41.160 [reactor-http-nio-3] DEBUG o.s.b.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'HDB' 2025-09-15 14:15:41.161 [reactor-http-nio-3] DEBUG o.s.b.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'HSQL' 2025-09-15 14:15:41.162 [reactor-http-nio-3] DEBUG o.s.b.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'Informix' 2025-09-15 14:15:41.162 [reactor-http-nio-3] DEBUG o.s.b.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'MS-SQL' 2025-09-15 14:15:41.162 [reactor-http-nio-3] DEBUG o.s.b.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'MySQL' 2025-09-15 14:15:41.162 [reactor-http-nio-3] DEBUG o.s.b.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'Oracle' 2025-09-15 14:15:41.163 [reactor-http-nio-3] DEBUG o.s.b.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'PostgreSQL' 2025-09-15 14:15:41.163 [reactor-http-nio-3] DEBUG o.s.b.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'Sybase' 2025-09-15 14:15:41.164 [reactor-http-nio-3] DEBUG o.s.jdbc.support.SQLErrorCodesFactory - Looking up default SQLErrorCodes for DataSource [com.hvlink.config.DataSourceConfig$1@2b0454d2] 2025-09-15 14:15:41.166 [reactor-http-nio-3] DEBUG o.springframework.jdbc.datasource.DataSourceUtils - Fetching JDBC Connection from DataSource 2025-09-15 14:15:41.169 [reactor-http-nio-3] DEBUG o.s.jdbc.support.SQLErrorCodesFactory - SQL error codes for 'Microsoft SQL Server' found 2025-09-15 14:15:41.169 [reactor-http-nio-3] DEBUG o.s.jdbc.support.SQLErrorCodesFactory - Caching SQL error codes for DataSource [com.hvlink.config.DataSourceConfig$1@2b0454d2]: database product name is 'Microsoft SQL Server' 2025-09-15 14:15:41.169 [reactor-http-nio-3] DEBUG o.s.j.support.SQLErrorCodeSQLExceptionTranslator - Unable to translate SQLException with Error code '102', will now try the fallback translator 2025-09-15 14:15:41.169 [reactor-http-nio-3] DEBUG o.s.jdbc.support.SQLStateSQLExceptionTranslator - Extracted SQL state class 'S0' from value 'S0001' 2025-09-15 14:15:41.176 [reactor-http-nio-3] DEBUG o.s.w.r.r.m.a.RequestMappingHandlerAdapter - [e7d590bf-1] Using @ExceptionHandler com.hvlink.exceptions.ExceptionHandle#handleException(Exception) 2025-09-15 14:15:41.184 [reactor-http-nio-3] ERROR com.hvlink.exceptions.ExceptionHandle - ===服务器内部错误== org.springframework.jdbc.UncategorizedSQLException: ### Error querying database. Cause: com.microsoft.sqlserver.jdbc.SQLServerException: “@P0”附近有语法错误。 ### The error may exist in file [D:\SHProjects\hv-link-backend\dao\target\classes\mapper\FactoryMapper.xml] ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: SELECT factory_code,factory_name,status FROM tm_factory OFFSET ? ROWS FETCH NEXT ? ROWS ONLY ### Cause: com.microsoft.sqlserver.jdbc.SQLServerException: “@P0”附近有语法错误。 ; uncategorized SQLException; SQL state [S0001]; error code [102]; “@P0”附近有语法错误。; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: “@P0”附近有语法错误。 at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:92) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:441) at com.sun.proxy.$Proxy118.selectList(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:224) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForIPage(MybatisMapperMethod.java:121) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:85) at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:148) at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89) at com.sun.proxy.$Proxy120.getFactory(Unknown Source) at com.hvlink.service.impl.FactoryServiceImpl.getFactoryList(FactoryServiceImpl.java:92) at com.hvlink.controller.FactoryController.getFactory(FactoryController.java:80) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.web.reactive.result.method.InvocableHandlerMethod.lambda$invoke$0(InvocableHandlerMethod.java:145) at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:125) at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1839) at reactor.core.publisher.MonoZip$ZipCoordinator.signal(MonoZip.java:258) at reactor.core.publisher.MonoZip$ZipInner.onNext(MonoZip.java:347) at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onNext(MonoPeekTerminal.java:180) at reactor.core.publisher.FluxDefaultIfEmpty$DefaultIfEmptySubscriber.onNext(FluxDefaultIfEmpty.java:101) at reactor.core.publisher.FluxHide$SuppressFuseableSubscriber.onNext(FluxHide.java:137) at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.complete(MonoIgnoreThen.java:292) at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onNext(MonoIgnoreThen.java:187) at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:236) at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:203) at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onComplete(MonoPeekTerminal.java:299) at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onComplete(MonoPeekTerminal.java:299) at reactor.core.publisher.MonoIgnoreElements$IgnoreElementsSubscriber.onComplete(MonoIgnoreElements.java:89) at reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:260) at reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:260) at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:144) at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1840) at reactor.core.publisher.MonoZip$ZipCoordinator.signal(MonoZip.java:258) at reactor.core.publisher.MonoZip$ZipInner.onNext(MonoZip.java:347) at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1839) at reactor.core.publisher.MonoCacheTime.subscribeOrReturn(MonoCacheTime.java:151) at reactor.core.publisher.Mono.subscribe(Mono.java:4475) at reactor.core.publisher.MonoZip.subscribe(MonoZip.java:129) at reactor.core.publisher.Mono.subscribe(Mono.java:4490) at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:263) at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:51) at reactor.core.publisher.Mono.subscribe(Mono.java:4490) at reactor.core.publisher.FluxFlatMap.trySubscribeScalarMap(FluxFlatMap.java:203) at reactor.core.publisher.MonoFlatMap.subscribeOrReturn(MonoFlatMap.java:53) at reactor.core.publisher.Mono.subscribe(Mono.java:4475) at reactor.core.publisher.MonoZip.subscribe(MonoZip.java:129) at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:240) at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:203) at reactor.core.publisher.MonoFlatMap$FlatMapMain.onComplete(MonoFlatMap.java:181) at reactor.core.publisher.Operators.complete(Operators.java:137) at reactor.core.publisher.MonoZip.subscribe(MonoZip.java:121) at reactor.core.publisher.Mono.subscribe(Mono.java:4490) at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:263) at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:51) at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:157) at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:74) at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:82) at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.innerNext(FluxConcatMap.java:282) at reactor.core.publisher.FluxConcatMap$ConcatMapInner.onNext(FluxConcatMap.java:863) at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:129) at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onNext(MonoPeekTerminal.java:180) at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2400) at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.request(MonoPeekTerminal.java:139) at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.request(FluxMapFuseable.java:171) at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.set(Operators.java:2196) at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onSubscribe(Operators.java:2070) at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onSubscribe(FluxMapFuseable.java:96) at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onSubscribe(MonoPeekTerminal.java:152) at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:55) at reactor.core.publisher.Mono.subscribe(Mono.java:4490) at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.drain(FluxConcatMap.java:451) at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.onSubscribe(FluxConcatMap.java:219) at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:201) at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:83) at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) at reactor.core.publisher.Mono.subscribe(Mono.java:4490) at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:263) at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:51) at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) at reactor.core.publisher.MonoDeferContextual.subscribe(MonoDeferContextual.java:55) at reactor.netty.http.server.HttpServer$HttpServerHandle.onStateChange(HttpServer.java:1112) at reactor.netty.ReactorNetty$CompositeConnectionObserver.onStateChange(ReactorNetty.java:707) at reactor.netty.transport.ServerTransport$ChildObserver.onStateChange(ServerTransport.java:481) at reactor.netty.http.server.HttpServerOperations.onInboundNext(HttpServerOperations.java:626) at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:114) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) at reactor.netty.http.server.HttpTrafficHandler.channelRead(HttpTrafficHandler.java:230) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436) at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318) at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.lang.Thread.run(Thread.java:750) Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: “@P0”附近有语法错误。 at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:259) at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1695) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:648) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:567) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7675) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:4137) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:272) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:246) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.execute(SQLServerPreparedStatement.java:544) at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:483) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59) at com.sun.proxy.$Proxy216.execute(Unknown Source) at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64) at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:64) at com.sun.proxy.$Proxy214.query(Unknown Source) at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:63) at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:325) at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:81) at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:62) at com.sun.proxy.$Proxy213.query(Unknown Source) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:151) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:145) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:427)
09-16
2025-09-17 10:56:11.582 [reactor-http-nio-2] DEBUG io.netty.buffer.AbstractByteBuf - -Dio.netty.buffer.checkAccessible: true 2025-09-17 10:56:11.582 [reactor-http-nio-2] DEBUG io.netty.buffer.AbstractByteBuf - -Dio.netty.buffer.checkBounds: true 2025-09-17 10:56:11.583 [reactor-http-nio-2] DEBUG io.netty.util.ResourceLeakDetectorFactory - Loaded default ResourceLeakDetector: io.netty.util.ResourceLeakDetector@7dd5cb9b 2025-09-17 10:56:11.621 [reactor-http-nio-3] DEBUG reactor.netty.http.server.HttpServerOperations - [2d85452d, L:/0:0:0:0:0:0:0:1:9000 - R:/0:0:0:0:0:0:0:1:27128] New http connection, requesting read 2025-09-17 10:56:11.621 [reactor-http-nio-2] DEBUG reactor.netty.http.server.HttpServerOperations - [3be99e76, L:/0:0:0:0:0:0:0:1:9000 - R:/0:0:0:0:0:0:0:1:27127] New http connection, requesting read 2025-09-17 10:56:11.621 [reactor-http-nio-2] DEBUG reactor.netty.transport.TransportConfig - [3be99e76, L:/0:0:0:0:0:0:0:1:9000 - R:/0:0:0:0:0:0:0:1:27127] Initialized pipeline DefaultChannelPipeline{(reactor.left.httpCodec = io.netty.handler.codec.http.HttpServerCodec), (reactor.left.httpTrafficHandler = reactor.netty.http.server.HttpTrafficHandler), (reactor.right.reactiveBridge = reactor.netty.channel.ChannelOperationsHandler)} 2025-09-17 10:56:11.621 [reactor-http-nio-3] DEBUG reactor.netty.transport.TransportConfig - [2d85452d, L:/0:0:0:0:0:0:0:1:9000 - R:/0:0:0:0:0:0:0:1:27128] Initialized pipeline DefaultChannelPipeline{(reactor.left.httpCodec = io.netty.handler.codec.http.HttpServerCodec), (reactor.left.httpTrafficHandler = reactor.netty.http.server.HttpTrafficHandler), (reactor.right.reactiveBridge = reactor.netty.channel.ChannelOperationsHandler)} 2025-09-17 10:56:11.634 [reactor-http-nio-2] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.maxCapacityPerThread: 4096 2025-09-17 10:56:11.634 [reactor-http-nio-2] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.ratio: 8 2025-09-17 10:56:11.634 [reactor-http-nio-2] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.chunkSize: 32 2025-09-17 10:56:11.634 [reactor-http-nio-2] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.blocking: false 2025-09-17 10:56:11.634 [reactor-http-nio-2] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.batchFastThreadLocalOnly: true 2025-09-17 10:56:11.674 [reactor-http-nio-3] DEBUG reactor.netty.http.server.HttpServerOperations - [2d85452d, L:/0:0:0:0:0:0:0:1:9000 - R:/0:0:0:0:0:0:0:1:27128] Increasing pending responses, now 1 2025-09-17 10:56:11.692 [reactor-http-nio-3] DEBUG reactor.netty.http.server.HttpServer - [2d85452d-1, L:/0:0:0:0:0:0:0:1:9000 - R:/0:0:0:0:0:0:0:1:27128] Handler is being applied: org.springframework.http.server.reactive.ReactorHttpHandlerAdapter@33cf3e0 2025-09-17 10:56:11.725 [reactor-http-nio-3] DEBUG o.s.web.server.adapter.HttpWebHandlerAdapter - [2d85452d-1] HTTP POST "/transportTime/query" 2025-09-17 10:56:11.770 [reactor-http-nio-3] DEBUG o.s.w.r.r.m.a.RequestMappingHandlerMapping - [2d85452d-1] Mapped to com.hvlink.controller.TransportTimeController#queryTransportTime(TransportTimeDTO) 2025-09-17 10:56:11.795 [reactor-http-nio-3] DEBUG o.s.w.r.r.m.a.RequestBodyMethodArgumentResolver - [2d85452d-1] Content-Type:application/json 2025-09-17 10:56:11.822 [reactor-http-nio-3] DEBUG o.s.w.r.r.m.a.RequestBodyMethodArgumentResolver - [2d85452d-1] 0..1 [com.hvlink.entity.dto.TransportTimeDTO] 2025-09-17 10:56:11.856 [reactor-http-nio-3] DEBUG reactor.netty.channel.FluxReceive - [2d85452d-1, L:/0:0:0:0:0:0:0:1:9000 - R:/0:0:0:0:0:0:0:1:27128] [terminated=false, cancelled=false, pending=0, error=null]: subscribing inbound receiver 2025-09-17 10:56:11.870 [reactor-http-nio-3] DEBUG o.s.http.codec.json.Jackson2JsonDecoder - [2d85452d-1] Decoded [TransportTimeDTO(id=null, companyCode=null, supplierCode=null, factoryCode=null, warehouseCode=null, (truncated)...] 2025-09-17 10:56:11.896 [reactor-http-nio-3] DEBUG org.mybatis.spring.SqlSessionUtils - Creating a new SqlSession 2025-09-17 10:56:11.907 [reactor-http-nio-3] DEBUG org.mybatis.spring.SqlSessionUtils - SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@72147d7e] was not registered for synchronization because synchronization is not active 2025-09-17 10:56:12.074 [reactor-http-nio-3] DEBUG o.springframework.jdbc.datasource.DataSourceUtils - Fetching JDBC Connection from DataSource 2025-09-17 10:56:12.357 [reactor-http-nio-3] INFO com.alibaba.druid.pool.DruidDataSource - {dataSource-1} inited 2025-09-17 10:56:12.827 [reactor-http-nio-3] DEBUG o.m.spring.transaction.SpringManagedTransaction - JDBC Connection [ConnectionID:1 ClientConnectionId: 000a2aef-f344-49bd-8137-a332fa003a01] will not be managed by Spring 2025-09-17 10:56:12.830 [reactor-http-nio-3] DEBUG c.h.m.T.selectTransportTimePage_mpCount - ==> Preparing: SELECT COUNT(*) AS total FROM tm_transport_time tt LEFT JOIN tm_supplier s ON tt.supplier_code = s.supplier_code LEFT JOIN tm_factory f ON tt.factory_code = f.factory_code LEFT JOIN tm_warehouse w ON tt.warehouse_code = w.warehouse_code WHERE s.supplier_name LIKE CONCAT('%', SUBSTRING_INDEX(?, ' - ', -1), '%') 2025-09-17 10:56:12.862 [reactor-http-nio-3] DEBUG c.h.m.T.selectTransportTimePage_mpCount - ==> Parameters: 00120000490012000049 - 丽清汽车科技(上海)有限公司(String) 2025-09-17 10:56:12.882 [reactor-http-nio-3] DEBUG org.mybatis.spring.SqlSessionUtils - Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@72147d7e] 2025-09-17 10:56:12.920 [reactor-http-nio-3] DEBUG o.s.beans.factory.xml.XmlBeanDefinitionReader - Loaded 11 bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml] 2025-09-17 10:56:12.921 [reactor-http-nio-3] DEBUG o.s.b.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'DB2' 2025-09-17 10:56:12.926 [reactor-http-nio-3] DEBUG o.s.b.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'Derby' 2025-09-17 10:56:12.926 [reactor-http-nio-3] DEBUG o.s.b.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'H2' 2025-09-17 10:56:12.926 [reactor-http-nio-3] DEBUG o.s.b.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'HDB' 2025-09-17 10:56:12.928 [reactor-http-nio-3] DEBUG o.s.b.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'HSQL' 2025-09-17 10:56:12.928 [reactor-http-nio-3] DEBUG o.s.b.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'Informix' 2025-09-17 10:56:12.928 [reactor-http-nio-3] DEBUG o.s.b.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'MS-SQL' 2025-09-17 10:56:12.929 [reactor-http-nio-3] DEBUG o.s.b.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'MySQL' 2025-09-17 10:56:12.929 [reactor-http-nio-3] DEBUG o.s.b.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'Oracle' 2025-09-17 10:56:12.929 [reactor-http-nio-3] DEBUG o.s.b.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'PostgreSQL' 2025-09-17 10:56:12.929 [reactor-http-nio-3] DEBUG o.s.b.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'Sybase' 2025-09-17 10:56:12.930 [reactor-http-nio-3] DEBUG o.s.jdbc.support.SQLErrorCodesFactory - Looking up default SQLErrorCodes for DataSource [com.hvlink.config.DataSourceConfig$1@73e4bb60] 2025-09-17 10:56:12.933 [reactor-http-nio-3] DEBUG o.springframework.jdbc.datasource.DataSourceUtils - Fetching JDBC Connection from DataSource 2025-09-17 10:56:12.943 [reactor-http-nio-3] DEBUG o.s.jdbc.support.SQLErrorCodesFactory - SQL error codes for 'Microsoft SQL Server' found 2025-09-17 10:56:12.943 [reactor-http-nio-3] DEBUG o.s.jdbc.support.SQLErrorCodesFactory - Caching SQL error codes for DataSource [com.hvlink.config.DataSourceConfig$1@73e4bb60]: database product name is 'Microsoft SQL Server' 2025-09-17 10:56:12.944 [reactor-http-nio-3] DEBUG o.s.j.support.SQLErrorCodeSQLExceptionTranslator - Unable to translate SQLException with Error code '195', will now try the fallback translator 2025-09-17 10:56:12.944 [reactor-http-nio-3] DEBUG o.s.jdbc.support.SQLStateSQLExceptionTranslator - Extracted SQL state class 'S0' from value 'S0010' 2025-09-17 10:56:12.948 [reactor-http-nio-3] DEBUG reactor.netty.channel.ChannelOperations - [2d85452d-1, L:/0:0:0:0:0:0:0:1:9000 - R:/0:0:0:0:0:0:0:1:27128] [HttpServer] Channel inbound receiver cancelled (operation cancelled). 2025-09-17 10:56:12.950 [reactor-http-nio-3] DEBUG o.s.w.r.r.m.a.RequestMappingHandlerAdapter - [2d85452d-1] Using @ExceptionHandler com.hvlink.exceptions.ExceptionHandle#handleException(Exception) 2025-09-17 10:56:12.957 [reactor-http-nio-3] ERROR com.hvlink.exceptions.ExceptionHandle - ===服务器内部错误== org.springframework.jdbc.UncategorizedSQLException: ### Error querying database. Cause: com.microsoft.sqlserver.jdbc.SQLServerException: 'SUBSTRING_INDEX' 不是可以识别的 内置函数名称。 ### The error may exist in file [D:\SHProjects\hv-link-backend\dao\target\classes\mapper\master-data\TransportTimeMapper.xml] ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: SELECT COUNT(*) AS total FROM tm_transport_time tt LEFT JOIN tm_supplier s ON tt.supplier_code = s.supplier_code LEFT JOIN tm_factory f ON tt.factory_code = f.factory_code LEFT JOIN tm_warehouse w ON tt.warehouse_code = w.warehouse_code WHERE s.supplier_name LIKE CONCAT('%', SUBSTRING_INDEX(?, ' - ', -1), '%') ### Cause: com.microsoft.sqlserver.jdbc.SQLServerException: 'SUBSTRING_INDEX' 不是可以识别的 内置函数名称。 ; uncategorized SQLException; SQL state [S0010]; error code [195]; 'SUBSTRING_INDEX' 不是可以识别的 内置函数名称。; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: 'SUBSTRING_INDEX' 不是可以识别的 内置函数名称。 at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:92) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:441) at com.sun.proxy.$Proxy114.selectList(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:224) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForIPage(MybatisMapperMethod.java:121) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:85) at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:148) at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89) at com.sun.proxy.$Proxy125.selectTransportTimePage(Unknown Source) at com.hvlink.service.impl.TransportTimeServiceImpl.getTransportTimeList(TransportTimeServiceImpl.java:126) at com.hvlink.service.impl.TransportTimeServiceImpl$$FastClassBySpringCGLIB$$3372699b.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) at org.springframework.aop.framework.CglibAopProxy.invokeMethod(CglibAopProxy.java:386) at org.springframework.aop.framework.CglibAopProxy.access$000(CglibAopProxy.java:85) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:703) at com.hvlink.service.impl.TransportTimeServiceImpl$$EnhancerBySpringCGLIB$$ec83b785.getTransportTimeList(<generated>) at com.hvlink.controller.TransportTimeController.queryTransportTime(TransportTimeController.java:87) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.web.reactive.result.method.InvocableHandlerMethod.lambda$invoke$0(InvocableHandlerMethod.java:145) at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:125) at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1839) at reactor.core.publisher.MonoZip$ZipCoordinator.signal(MonoZip.java:258) at reactor.core.publisher.MonoZip$ZipInner.onNext(MonoZip.java:347) at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onNext(MonoPeekTerminal.java:180) at reactor.core.publisher.FluxDefaultIfEmpty$DefaultIfEmptySubscriber.onNext(FluxDefaultIfEmpty.java:101) at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:74) at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79) at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1839) at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:151) at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onNext(FluxContextWrite.java:107) at reactor.core.publisher.FluxMapFuseable$MapFuseableConditionalSubscriber.onNext(FluxMapFuseable.java:299) at reactor.core.publisher.FluxFilterFuseable$FilterFuseableConditionalSubscriber.onNext(FluxFilterFuseable.java:337) at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1839) at reactor.core.publisher.MonoCollect$CollectSubscriber.onComplete(MonoCollect.java:160) at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:144) at reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:260) at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:144) at reactor.netty.channel.FluxReceive.onInboundComplete(FluxReceive.java:415) at reactor.netty.channel.ChannelOperations.onInboundComplete(ChannelOperations.java:439) at reactor.netty.http.server.HttpServerOperations.onInboundNext(HttpServerOperations.java:656) at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:114) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) at reactor.netty.http.server.HttpTrafficHandler.channelRead(HttpTrafficHandler.java:276) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436) at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318) at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.lang.Thread.run(Thread.java:750) Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: 'SUBSTRING_INDEX' 不是可以识别的 内置函数名称。 at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:259) at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1695) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:648) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:567) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7675) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:4137) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:272) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:246) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.execute(SQLServerPreparedStatement.java:544) at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:483) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59) at com.sun.proxy.$Proxy196.execute(Unknown Source) at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64) at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:64) at com.sun.proxy.$Proxy194.query(Unknown Source) at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:63) at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:325) at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) at com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor.willDoQuery(PaginationInnerInterceptor.java:135) at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:75) at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:62) at com.sun.proxy.$Proxy193.query(Unknown Source) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:151) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:145) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:427) ... 69 common frames omitted 2025-09-17 10:56:12.963 [reactor-http-nio-3] DEBUG o.s.w.r.r.m.annotation.ResponseBodyResultHandler - [2d85452d-1] Using 'application/json' given [*/*] and supported [application/json, application/*+json, application/x-ndjson, text/event-stream] 2025-09-17 10:56:12.963 [reactor-http-nio-3] DEBUG o.s.w.r.r.m.annotation.ResponseBodyResultHandler - [2d85452d-1] 0..1 [com.hvlink.common.Result<?>] 2025-09-17 10:56:12.974 [reactor-http-nio-3] DEBUG o.s.http.codec.json.Jackson2JsonEncoder - [2d85452d-1] Encoding [Result(status=500, msg=发现未知问题,联系管理员!, data=null, timestamp=1758077772958)] 2025-09-17 10:56:12.988 [reactor-http-nio-3] DEBUG reactor.netty.http.server.HttpServerOperations - [2d85452d-1, L:/0:0:0:0:0:0:0:1:9000 - R:/0:0:0:0:0:0:0:1:27128] Decreasing pending responses, now 0 2025-09-17 10:56:12.988 [reactor-http-nio-3] DEBUG reactor.netty.http.server.HttpServerOperations - [2d85452d-1, L:/0:0:0:0:0:0:0:1:9000 - R:/0:0:0:0:0:0:0:1:27128] Last HTTP packet was sent, terminating the channel 2025-09-17 10:56:12.994 [reactor-http-nio-3] DEBUG o.s.web.server.adapter.HttpWebHandlerAdapter - [2d85452d-1] Completed 500 INTERNAL_SERVER_ERROR 2025-09-17 10:56:12.996 [reactor-http-nio-3] DEBUG reactor.netty.http.server.HttpServerOperations - [2d85452d-1, L:/0:0:0:0:0:0:0:1:9000 - R:/0:0:0:0:0:0:0:1:27128] Last HTTP response frame 我是sqlserver
09-18
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

mark_to_win

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值