首页 \ 问答 \ 遇到一个mysql问题

遇到一个mysql问题

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?values(2)' at line 1. 我的mysql语句为: String sql1="select * from telephone where username=?"; 		String sql2="values("+username+")"; at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) 	atreflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)at java.lang.reflect.Constructor.newInstance(Constructor.java:526) 	at com.mysql.jdbc.Util.handleNewInstance(Util.java:409) 	at com.mysql.jdbc.Util.getInstance(Util.java:384) 	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054) 	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3566) 	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3498) 	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959) 	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2113) 	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2562) 	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2512) 部分错误信息。 String sql="select * from telephone where username=?"; 		pst=con.prepareStatement(sql); 		pst.setString(1,username); 		rs=pst.executeQuery(sql); 上面是我改过的mysql语句但是接着报以下这个错误: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 1。 在此先谢谢了。
更新时间:2023-07-09 22:07

最满意答案

找个人教下最好

其他回答

到这两个网站看下,东西蛮多的,可能你要得上吧!

相关问答

更多
  • 软件自身就带了一些帮助说明,里面有操作教学的 …… 打开软件之后,按F1,侧边会出现帮助框,然后在帮助框的搜索条下面会看到“目录”进目录就能看到了
  • 免费的很难找,人家都是卖钱的
  • 一般要培训软件使用方法。因为培训属于售后服务内容之一。   售后服务是售后最重要的环节。售后服务已经成为了企业保持或扩大市场份额的要件。售后服务的优劣能影响消费者的满意程度。在购买时,商品的保修、售后服务等有关规定可使顾客摆脱疑虑、摇摆的形态,下定决心购买商品。优质的售后服务可以算是品牌经济的产物,在市场激烈竞争的今天,随着消费者维权意识的提高和消费观念的变化,消费者们不再只关注产品本身,在同类产品的质量与性能都相似的情况下,更愿意选择这些拥有优质售后服务的公司。   客观地讲,优质的售后服务是品牌经济的产 ...
  • 现在学这个软件没有以前好了,我觉得你要是想学的话还是去其它的地方当学徒,在当学徒的时候在网上卖那个学习的教程,这样一边学一边看,就差不多半年就能够学会了,哦对了一定要把那个磨刀一定要学会了,这样算起来差不多一年吧。我现在搞这个电脑雕刻差不多有10年了,感觉也就那个样子真的。还是只有自己开店赚钱才是硬道理,我现在就打算自己买雕刻机开店了,加油吧兄弟
  • 网站分为静态的和动态的,也就是网站设计和网站编程。 先说设计,主要使用网页三剑客:] 网页设计用网页三剑客了。 学以致用——网页三剑客MX 2004中文版典型实例教程 http://book.jqcq.com/product/570852.html 本书通过丰富而典型的实例,详尽介绍了MacromediaStudioMX 2004中文版在网站建设、网页制作、动画制作、网页图形图像设计方面的应用。全书共分四章,前三章分别讲解DreamweaverMX2004、FireworksMX2004和FlashMX20 ...
  • 找个人教下最好
  • 网易学院的教程,分步很细 http://tech.163.com/special/000915SN/Photoshopcs.html
  • http://kingdee.com/products/kis/index.jsp 下载软件后,按F1帮助,软件里有一套演示账套,边学边看账套才是最有效的!免费的教程不会有ERP的!只有下载软件或者接授才能帮自己!
  • 我有,还有教学视频课程,
  • 精雕教程书籍[2023-01-26]

    这个帮助有80M左右,你加入17901684北京精雕群,看看谁传给你吧

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)