unspecified 适用范围,解决问题现象(APP)

文档用途

最近项目中,经常遇到需要URL里添加stringtype=unspecified情况。什么情况下需要添加呢?

详细信息

1、直接URL添加stringtype=unspecified

2、程序里报类似ERROR: column is of type timestamp without time zone but expression is of type character varying错误 ,取出SQL放到数据库正常执行,URL再添加stringtype=unspecified

pg社区对此处的解释

stringtype = String

specify the type to use when binding PreparedStatement parameters set via setString(). If stringtype is set to varchar(the default), such parameters will be sent to the server as varchar parameters. If stringtype is set to unspecified, parameters will be sent to the server as untyped values, and the server will attempt to infer an appropriate type. This is useful if you have an existing application that uses setString() to set parameters that are actually some other type, such as integers, and you are unable to change the application to use an appropriate method such as setInt().

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值