SQLite 准备语句的转义替代方案
我在 BlackBerry 移动设备上实现了 SQLite 数据库。我的问题是 BlackBerry API 非常有限,并且不提供准备好的语句。因此,我无法(轻松)转义 SQL 来防止 SQL 注入。有人有其他选择吗?不幸的是,我也无法使用 REGEX...
我基本上需要对所有特殊字符执行replaceAll() 吗?
谢谢!
I have implemented an SQLite database on a BlackBerry mobile device. My problem is that the BlackBerry API is very limited, and does not offer prepared statements. Therefore, I am unable to (easily) escape the SQL to prevent against SQL injection. Does anyone have any alternatives? Unfortunately, REGEX is not available to me either...
Do I basically need to do a replaceAll() for all special characters?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我对你的断言感到惊讶,即 Blackberry 上的 SQLite 不支持准备好的语句,因为少量的谷歌搜索和链接跟踪引导我到 此示例,它准确地展示了如何使用位置参数执行准备好的语句。
I am surprised at your assertion that there are no prepared statements supported for SQLite on Blackberry, given that a tiny amount of googling and link following leads me to this example which shows exactly how to do a prepared statement with positional parameters.