占位符和参数之间的区别
Difference between Placeholder and parameter
我正在观看有关 JDBC 的课程,当讲师在 Prepared Statement 中谈到 ?
(问号)时,他说:
Before I execute the Query, I have to fill in the placeholders or parameters.
他说的是这样的查询:
SELECT * FROM Employee where salary > ?
现在,我的主要问题是:
占位符和参数有什么区别?
他是不是错了? ?
可以是占位符还是参数?
编辑:
我也考虑这两个定义:
argument is the value/variable/reference being passed in, parameter is the receiving variable
没有区别,这只是用于相同事物的两个术语。这可能就是使用该短语的原因:介绍这两个术语并表明它们可以互换使用。甚至还有第三种变体,其中两者组合在一个术语中:parameter placeholder.
在我看来,?
是一个值的 占位符 ,但同时也是一个 参数 用于查询。
我正在观看有关 JDBC 的课程,当讲师在 Prepared Statement 中谈到 ?
(问号)时,他说:
Before I execute the Query, I have to fill in the placeholders or parameters.
他说的是这样的查询:
SELECT * FROM Employee where salary > ?
现在,我的主要问题是:
占位符和参数有什么区别?
他是不是错了? ?
可以是占位符还是参数?
编辑:
我也考虑这两个定义:
argument is the value/variable/reference being passed in, parameter is the receiving variable
没有区别,这只是用于相同事物的两个术语。这可能就是使用该短语的原因:介绍这两个术语并表明它们可以互换使用。甚至还有第三种变体,其中两者组合在一个术语中:parameter placeholder.
在我看来,?
是一个值的 占位符 ,但同时也是一个 参数 用于查询。