参数化查询的基础知识 [英] basics of parameterized query

查看:118
本文介绍了参数化查询的基础知识的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1.我已经使用参数化查询几个时间我知道它在preventing SQL注入帮助
但我想知道如果我能知道什么是基本的逻辑参数化查询内部工作
以prevent SQL注入可能是很简单的,但我不知道这件事。我试图搜索谷歌是什么每当我找到了一个例子,如何在Asp.net使用参数化查询时它的基本的,但。

1.i have used parameterized query several time i know it help in preventing sql injection but i was wondering if i can know what is basic logic working inside a parameterized query to prevent sql injection may be it is very simple but i don't know about it. i tried to search google what are the basic of it but every time i found an example that how to use parameterized query in Asp.net.

2.我知道做一个特殊的类,它停止就像那些特殊字符(', - 等),这是在SQL注入中使用,但只回采特殊字符完全prevent SQL注入?
而最后一件事不.NET paramerterized查询可以完全阻止SQL注入?

2.I know about making a special class which stop those special character like (',-- etc) which are used in sql injection, but does stoping only special characters totally prevent sql injection? and one last thing does .net paramerterized query can fully stop sql injection?

推荐答案

我觉得参数化查询是不依赖于prepared查询数据库的支持。数据库驱动程序本身传递值的安全方法,以及它是如何做取决于驱动器本身。

I think parametrized queries are not dependent on prepared queries database support. Database driver itself passing values the safe way, and how is it done depends on driver itself.

借助 PostgreSQL的手册说明有关参数化查询的基础知识数据库级别。

在另一方面,参数化查询简化你传递区域的敏感数据。
例如,用户输入十进制10万,但是你的服务器期望100.00价值。

On the other hand, parametrized queries simplifies you passing locale sensitive data. For example, user enters 100,00 decimal, but your server expects 100.00 value.

这篇关于参数化查询的基础知识的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆