We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用 1.5.3版本
预期行为:插入无报错
实际行为:插入报错
步骤:
<bean id="ds_0" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="com.mysql.jdbc.Driver"/> <property name="url" value="jdbc:mysql://localhost:3306/ds_0"/> <property name="username" value="root"/> <property name="password" value="wqch"/> </bean> <bean id="ds_1" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="com.mysql.jdbc.Driver"/> <property name="url" value="jdbc:mysql://localhost:3306/ds_1"/> <property name="username" value="root"/> <property name="password" value="wqch"/> </bean> <rdb:master-slave-data-source id="shardingDataSource" master-data-source-ref="ds_0" slave-data-sources-ref="ds_1" /> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="shardingDataSource" /> </bean> <tx:annotation-driven transaction-manager="transactionManager" />
2.具体的错误: Exception in thread "main" org.springframework.jdbc.BadSqlGrammarException:
; bad SQL grammar []; nested exception is java.sql.SQLException: No value specified for parameter 1
注:但是在执行例如查询所有,删除所有等没有传递参数的操作,程序将顺利执行
3注假如不使用读写分离,仅仅注释一下配置,不用改代码,程序将顺利执行插入操作
4.github地址 https://github.com/wangqingchengsg/sharding-jdbc-example-mybatis
The text was updated successfully, but these errors were encountered:
For #362.
378ac47
fix #362
59450b9
Diao,今天上午才遇到这个问题,还以为是我自己的原因,也没深究
Sorry, something went wrong.
No branches or pull requests
使用 1.5.3版本
预期行为:插入无报错
实际行为:插入报错
步骤:
1.报错时的配置:
2.具体的错误:
Exception in thread "main" org.springframework.jdbc.BadSqlGrammarException:
Error updating database. Cause: java.sql.SQLException: No value specified for parameter 1
The error may involve defaultParameterMap
The error occurred while setting parameters
SQL: INSERT INTO t_order(order_id,user_id, status) VALUES ( ?, ?, ? )
Cause: java.sql.SQLException: No value specified for parameter 1
; bad SQL grammar []; nested exception is java.sql.SQLException: No value specified for parameter 1
注:但是在执行例如查询所有,删除所有等没有传递参数的操作,程序将顺利执行
3注假如不使用读写分离,仅仅注释一下配置,不用改代码,程序将顺利执行插入操作
4.github地址 https://github.com/wangqingchengsg/sharding-jdbc-example-mybatis
The text was updated successfully, but these errors were encountered: