通过动态使用jsp sql标记将值插入到mysql中 [英] inserting values into mysql by dynamically using jsp sql tags

查看:99
本文介绍了通过动态使用jsp sql标记将值插入到mysql中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨frnds am strucking我不能动态地将值插入到mysql中,所以如果pls帮助我,如果有人......可能早。谢谢..



代码是:



hi frnds am strucking and i cant geting for inserting values into mysql by dynamically,so if pls help me if anybody..as possible early.thanks..

code is:

<%
 String companyName=request.getParameter("cname");
 String companyAddress=request.getParameter("caddress");
 String city=request.getParameter("city");
 String country=request.getParameter("country");
 String zip=request.getParameter("zip");
 %>
 <sql:setDataSource var="snapshot" driver="com.mysql.jdbc.Driver"

    url="jdbc:mysql://localhost/dmd"

    user="root"  password="root"/>

    <sql:update dataSource="${snapshot }" var="result">
    insert into dmd.company(companyName,companyAddress,city,country,zip) values('?','?','?','?','?');

    </sql:update>

推荐答案

{snapshot} var = result >
插入dmd.company(companyName,companyAddress,city,country,zip)值('?','?','?' ,'?','?');

< / sql:update >
{snapshot }" var="result"> insert into dmd.company(companyName,companyAddress,city,country,zip) values('?','?','?','?','?'); </sql:update>


这篇关于通过动态使用jsp sql标记将值插入到mysql中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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