Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 18-11-2009
Member
 
Join Date: Nov 2008
Posts: 25
requete sql

hello ,

i have a problem with this requete :java.sql.ResultSet curseur=s.executeQuery("select latitude, longitude, nomville from liste_magasins where (latitude between"+ lat + " and " + lat + "+" + step + ") and (longitude between "+ lon + " and " + lon + "+"+step+ ") LIMIT 5");

i done a erreur :erreur selectioncom.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'between49.894593 and 49.894593+10.0) and (longitude between 2.298256 and 2.29825' at line 1
thank you
Reply With Quote
  #2  
Old 18-11-2009
Member
 
Join Date: Feb 2008
Posts: 1,848
Re: requete sql

It may not be obvious but you need to "escape placeholder characters" such as question marks, exclamation points, and ampersands when preparing a query. According to me, i think you should try to use some space in between them. That might help you to resolve your issue.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags:



Thread Tools Search this Thread
Search this Thread:

Advanced Search



All times are GMT +5.5. The time now is 03:01 AM.