请教new SqlParameter
来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/19 02:51:31
请教new SqlParameter
应该是预编译的一种方式,先写出没有加参数的SQL
然后再用这种方式把参数加上去
如:String sql = "select * from users where userid=:LoginId and pwd=:LoginPwd";//这个SQL里面的参数没有给值
SqlParameter [] para = new SqlParameter []
{
new SqlParameter ("@LoginId",user.LoginId),
new SqlParameter ("@LoginPwd",user.LoginPwd),
};
Query q = conn.getQuery(sql);
q.setParameter(para);
List l = q.getList();
大概是这个意思,这是我手写的代码;可能有错误,但是思路肯定是这样的
然后再用这种方式把参数加上去
如:String sql = "select * from users where userid=:LoginId and pwd=:LoginPwd";//这个SQL里面的参数没有给值
SqlParameter [] para = new SqlParameter []
{
new SqlParameter ("@LoginId",user.LoginId),
new SqlParameter ("@LoginPwd",user.LoginPwd),
};
Query q = conn.getQuery(sql);
q.setParameter(para);
List l = q.getList();
大概是这个意思,这是我手写的代码;可能有错误,但是思路肯定是这样的
new SqlParameter("@id",model.id)和 new SqlParameter("Id",mode
new SqlParameter()在括号中可不可写多个参数
请教一些英语语法句型Admittedly, since we move to a new city or new cou
请教!!!
Prepare a performance for the New Year's party in groups 请教中
英语句子有疑惑He fully acquaint himself with his new duties,请教在这个句子
请教英语句型I'm quitting smoking for my new year's resolution为什么sm
请教一道填空题They ______(appoint)three new teachers this year.答案是h
New
请教一道英语自考语法反义疑问句的题目:You'd rather I didn't tell her the new,对应
请教一道英语题He'll use what he has ( ) her a new dressA bought B t
请教一道英语题:Bees help flowers makes new seeds.这里的makes为什么要加s?