Wednesday, 15 February 2012

mysql - Java : error in SQL syntax -


I am trying to get information from my database with the following database:

  select retrieve string = "o.order_id, o.betalingsKenmerk, o.betaalMethode, o.tijdstipBezorging, o.datum" + ", o.adres, o.huisnummer, o.postcode, o.woonplaats, o. Lndkde, O.akstranfao, Okopmerking "+", Okaltemail, Okvurnam, Okactrnam, Okbedrijfshnam, Oktelnummer, Okbetald, Okbejorgkosten "+", Oktotaleksbzg, o. SiteCode, o.opmerking "+", IF (O transacityIID = 1, 1,0) "+" AS pickup, RST_ID, TRIM (CNACAT (RNAM, '', RFIIL)) order O index (connectieid, doorberekenen) Ignore "+" Internal join the connectie index (methode) "+" o.connectieId = c.id "+" and c.methode = 26 "ignore c +" internal included When restaurant r "+" on o.restaurantRest_id = r.rest_id "+" Where o.datum & gt; = TIMESTAMP (CURDATE ()) "+" and o.order_statusOrder_status_id = '1' "+" o. Order_statusOrder_device_id = ? "+" And o.doorberekenen = '1' "+" and ((o.bevestigingsId is void or o.bevestigingsId = 0) and o.bevestigdDoor is faucet) ";  

But I get an error:

[17-03-2015 10:20:57] [FATAL] [orderer]
Error: Com.mysql.jdbc.exceptions.jdbc4. MySQLSyntaxErrorException: There is an error in your SQL syntax; Check that the manual that matches the correct version of the syntax corresponds to your server version, check 'thuis.order o the ignore index (connectieid, doorberekenen) interiors join the connectie IGN 'Line 1

but I I have tried this question on the database from SQL Manager inside Netbeans and it works just fine, but when I try to write it again for Java, it only leaves the error.

I am unable to find the solution

You are missing a location

  "thuis.order o ignor index .order o ignor ind The bus (Knektiid, without it, restnameFROM has not become a term and Farm section.  

Similarly you should add a location to the beginning or the end of most of your lines.

This should work:

  Recover the string = "SELECT o.order_id, o.be TalingsKenmerk, o.betaalMethode, o.tijdstipBezorging, o.datum" + ", O.adres, o.huisnummer, o.postcode, o.woonplaats, o.landcode, o.extrainfo, o.opmerking" + ", o altEmail, o.voornaam, o.achternaam, o.bedrijfsname, o .telnummer, o.betaald, "+", o.totaalExBzg, o.siteCode, o.opmerking "+", o.bezorgkosten IF (o.transactieID = -1, 1,0) "+" AS Pickup, R. Rest_aidi, Tiaraim (Konkat (Aranam, 'Arfilial)) AS Visran name "+" of Thiyenskordr o Ignor Index (Knektiiad, Dorbereknenn) "+" INNER Knekti C. Ignor Index (Method) "+" o ConnectIID = CID "+" and C Methodode = 26 "+" INNER Join restaurant R "+" On osteridge_ind = R.resh_id "+" Where o Datmma = = TIMESTAMP (Curate ()) and "+" .order_statusOrder_s Tatus_id = '1' "+" and o.order_statusOrder_device_id =? "+" and o.doorberekenen = '1' "+" and ((o.bevestigingsId zero or o.bevestigingsId = 0) and o.bevestigdDoor iS Null) ";  

No comments:

Post a Comment