sql語句無法正常執行

來源:互聯網
上載者:User

有些時候,自己的sql語句在sql server中執行正常,但就是在jsp檔案中行不通。很有可能使符號問題 ' 和 "是不一樣的。注意到區別 了嗎

 

String sql="select medals.medal,medals.event,medals.sport,athletes.code,athletes.name,athletes.country from athletes,medals where (athletes.code=medals.code) and (athletes.country='"+name_get+"')";

必須用'

不能用'

因為sql server執行時靠 '  ,不識別 "

 

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.