You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/02/11 06:51:27 UTC

[GitHub] [shardingsphere] dissdic commented on issue #15134: to consider the sqlType of value parameter when setting the value to the corresponding placeholder in a executing SQL

dissdic commented on issue #15134:
URL: https://github.com/apache/shardingsphere/issues/15134#issuecomment-1035925561


   I'm sorry ,it's my fault,I mean when I use spring-boot-starter-jdbc for interaction with Database.unlike other frameworks like mybatis, we may obtain Connection instance and PreparedStatement instance manually and use them to execute SQL directly.In shardingsphere,the implementation of&nbsp; PreparedStatement interface that we usually use is ShardingspherePreparedStatement which is also a subclass of AbstractPreparedStatementAdapter,as we get a SQL and there are some condition placeholder or value placeholder in the form of '?',so we need set specific value to the corresponding placeholder,in a case of that we're not sure of the database types of some fields we tend to set values in a SQL due to they were generated automatically,then we can only use the method setObject(..) to do so which is implemented in the abstract class AbstractPreparedStatementAdapter,now the problem is the implementation seems to not consider the sql type argument despite in the method `void setObject(int p
 arameterType,Object x,int targetSqlType)` we've actually presented while invocation,and just set the Object value we present without any type conversion,and that cause error from underlying jdbc code.
   
   
   this's basically the main problem i met while using shardingsphere currently,do you think it should be a problem or not? and I've fix it on local,can I commit a PR?
   
   
   ------------------&nbsp;原始邮件&nbsp;------------------
   发件人:                                                                                                                        "apache/shardingsphere"                                                                                    ***@***.***&gt;;
   发送时间:&nbsp;2022年2月10日(星期四) 下午2:10
   ***@***.***&gt;;
   ***@***.******@***.***&gt;;
   主题:&nbsp;Re: [apache/shardingsphere] to consider the sqlType of value parameter when setting the value to the corresponding placeholder in a executing SQL (Issue #15134)
   
   
   
   
   
    
   Hi @dissdic
    Could you provide more informations and show us how to reproduce your problem? I can hardly understand your problem from your brief descriptions.
    
   —
   Reply to this email directly, view it on GitHub, or unsubscribe.
   Triage notifications on the go with GitHub Mobile for iOS or Android. 
   You are receiving this because you were mentioned.Message ID: ***@***.***&gt;


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org