Problems with PreparedStatement when select restrict are byte params

Hi,
i have a problem trying to select information when the "select" has a byte restrict.
The table in database is:
CREATE TABLE `positions` (
`PKID` int(10) unsigned NOT NULL auto_increment,
`POSCODE` varbinary(30) NOT NULL,
`ISWTURN` binary(1) NOT NULL,
`QTT_GAMES` int(10) unsigned NOT NULL default '1',
PRIMARY KEY (`PKID`),
UNIQUE KEY `UNIQ_POS` (`POSCODE`,`ISWTURN`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
And the test code to get the qtt_games is :
conn = DriverManager.getConnection (url,user,pwd);
byte bcode[] = poscode.getByteArrayCode();
// bcode is inserted ok in another preparedstatement...
String query = "SELECT qtt_games FROM positions "+
"WHERE poscode=? and iswturn=?";
PreparedStatement pstmt = conn.prepareStatement(query);
pstmt.setBytes (1,bcode);
pstmt.setByte (2,poscode.getIsWhiteTurn()); //it returns a byte
ResultSet rs = pstmt.executeQuery (query);
When pstmt.executeQuery is reached, it's thrown the exception:
com.mysql.jdbc.exceptions.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 '=? and iswturn=?' at line 1
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3170)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3099)
at com.mysql.jdbc.Statement.execute(Statement.java:695)
at app.server.bbdd.MYSQLBDManager.getGamesBasicInfo(MYSQLBDManager.java:942)
at app.server.bbdd.MYSQLBDManager.main(MYSQLBDManager.java:1068)
Can anybody tell me what's wrong?? I think the query is ok, but don't know what's happening with this...
Lots of thanks.

Hi,
sorry, i know i've post this same message by error in "new to java" thread.... (i'm new in the forum... can i delete the wrong comment??)
The SQLState is 42000 (syntax error), but it doesn't give me much information because i had already searched in google why can be the cause of it, but there are only a few comments about problems like this, without a solution...
The column poscode in the table positions contains an array of bytes that codify a position in a chess board. I've to use this in the WHERE clause because i'm developing a chess game consulting project where there are millions of different positions and i've to get the games that have the same position in it's position history.
The code to insert the positions is:
query = "INSERT INTO positions VALUES "+
     "(null,?,?,default) "+
     "ON DUPLICATE KEY UPDATE qtt_games=qtt_games+1";
pstmt = conn.prepareStatement(query,Statement.RETURN_GENERATED_KEYS);
pstmt.setBytes(1,bcode);
pstmt.setByte(2,poscode.getIsWhiteTurn());
pstmt.executeUpdate();
which works ok and positions can be seen from mysql browser, but i can't select them using the PreparedStatement..
I have been searching a lot of information about this problem with no results... this is the why i posted this...
Any help will be useful, thanks.

Similar Messages

  • HT1338 Problem with MAIL, when select names that start with "E" the mail freeze. Can't fix it.

    Problem with MAIL, when select names that start with "E" the mail freeze. Can't fix it.

    Now I checked the materials that I got from AT&T Yahoo and
    port 25 is used as the outgoing mail port, 110 for incoming.
    This is for the POP type account provided by AT&T, not necessarily for an email account and SMTP server not provided by AT&T.
    Sounds like AT&T blocks using an SMTP server that is outside of their network or not provided by AT&T on Port 25.
    Try the following first.
    Go to Mail > Preferences > Accounts and under the Account Information tab for your .Mac account preferences at the SMTP server selection, select the Server Settings button below for the .Mac SMTP server.
    Enter 587 in place of 25 in the Server Port field and when finished, select OK to save the changed setting.
    If this doesn't work, we will go to plan B.

  • Problems  with CS4 when several photos are open

    Hello all,
    I have a problem with Photoshop CS4. When I have several photos open, the borders of the underlying is shining through:
    This remains until I move the upper picture. Its a rather ennoying effect...
    My configuration is the following:
    Windows XP Professional SP3, Pentium 4 Dual 3.2 Ghz, 3.25 GB RAM, NVidia Quadro FX 1500, driver 6.14.11.8120, plenty of HD space, etc...
    Photoshop CS4 11.0.1
    Who can help?
    Thanks in advance, Dan

    What springs to the eye is that it's the UI elements (the frames around the images) not the pixel content, so I'd rule out any OpenGL issues. More likely it's a general memory shortage of the graphics system, which either is due to using excessive screen resolutions, another app stealing resources or a configuration problem. I would definitely check the NVidia panel and see, if you have not inadvertently toggled some critical setting. Furthermore look, whether some program is running in the background that may steal the screen buffer. Funnily, Corel Capture could be such a suspicious tool, if it's running all the time. Also turn off the rulers. There has been an issue with those and it may still not be fixed in the latest update. As a last thing to look into, of course make sure to get rid of any fancies you may be using, e.g. drop shadows on your windows, a desktop image, transparent window dragging and such. all those consume memory on the graphics card.
    Mylenium

  • Problems with shortcuts when selecting file to upload in BPS

    Hi all,
    We have a problem when the user is navigating through the directories for selecting a file to upload. When the user navigates between folders it is ok but if there is a shortcut to another disc the program interprets that as a file and then generates a lot of errors in BPS.
    This worked only a month ago and the only thing we have changed is a GUI upgrade from 640 to 710. Could this be the problem?
    We are using cl_gui_frontend_services=>file_open_dialog for uploading files in the planning layout.
    We are on:
    BW: 3.5 Patch 17
    GUI: 710
    SEM: 4 Patch 8
    Thanks for any help!
    Best Regards
    Pontus

    Hello Pontus,
    maybe you are using the incorrect file/path separator. Check SAP Note <a href="http://service.sap.com/sap/support/notes/1266211">1266211[</a> on how to get the correct separator.
    Regards,
    Marc
    SAP NetWeaver RIG

  • Problem with dnsextd when creating Wide-Area-Bonjour

    Hello,
    I've been struggling for some time trying to create a WAB test environment but without success and would appreciate some help.
    Im using a mac mini (later 2014) running Yosemite to run bind (9.10) and ISC for a testing zone with DDNS enabled. This setup is running perfectly with or without TSIG (both ways run perfectly).
    When I try to include dnsextd in this setup for LLQ is where the problem start. No more DDNS updates. When I run dnsextd in debug mode, it shows the following message:
    "Rejecting Update Request with 2 additions but no lease".
    The dhcp logs report RCODE 5 (from dnsextd), which means REFUSED.
    Any ideias?
    I see a lot of website (including DNS-SD.org) with very simple cookbooks explaining how to create the WAB environment, but I cant make it work. Even if I configure the zone keys in dnsextd, it wont work. The error change to a new one (dnsextd responds without TSIG, which is not accepted by the DHCP server) and it wont work also.
    Any idea of fix would be appreciated.

    thanks for the quick reply AndrewTJ - I did notice the typo after posting and corrected however the problems remains.  below is the contents of my up.com.dns file - i can see nothing out of place but cannot get a resolution
    ;  Database file up.com.dns for up.com zone.
    ;      Zone version:  22
    @                       IN  SOA dns1.up.com.  hostmaster.up.com. (
                             22           ; serial number
                             900          ; refresh
                             600          ; retry
                             86400        ; expire
                             3600       ) ; default TTL
    ;  Zone NS records
    @                       NS dns1.up.com.
    ;  Zone records
    _http._tcp.up.com.              PTR website._http._tcp.up.com.
    website._http._tcp.up.com.      TXT ( "txt path=/" )
                             SRV 0 0 80 dns1.up.com.
    _services._dns-sd._udp.up.com.  PTR _http._tcp.up.com.
    b._dns-sd._udp.up.com.          PTR @
    lb._dns-sd._udp.up.com.         PTR @
    dns1.up.com.                    A 192.168.1.153
    Any ideas?

  • Having a problem with dates when I send my numbers doc to excel. dates are all out and that they have to cut and paste individual entries onto their spreadsheet. Any idea how I can prevent this

    having a problem with dates when I send my numbers doc to excel. dates are all out and that they have to cut and paste individual entries onto their spreadsheet. Any idea how I can prevent this.
    I'm using Lion on an MBP and Numbers is the latest version

    May you give more details about what is wrong with your dates ?
    M…oSoft products aren't allowed on my machines but I use LibreOffice which is a clone of Office.
    When I export from Numbers to Excel and open the result with LibreOffice, the dates are correctly treated.
    To be precise, dates after 01/01/1904 are correctly treated. dates before 01/01/1904 are exported as strings but, as it's flagged during the export process, it's not surprising.
    Yvan KOENIG (VALLAURIS, France) mardi 3 janvier 2012
    iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My iDisk is : http://public.me.com/koenigyvan
    Please : Search for questions similar to your own before submitting them to the community
    For iWork's applications dedicated to iOS, go to :
    https://discussions.apple.com/community/app_store/iwork_for_ios

  • I have a problem with itunes when I sync the saved music and want to sync my iphone 5 ios 7.0.6 no longer passes the music thing is that just stays on "waiting for sync" and not worry please help are more than 400 songs that do not want to hear who are wi

    I have a problem with itunes when I sync the saved music and want to sync my iphone 5 ios 7.0.6 no longer passes the music thing is that just stays on "waiting for sync" and not worry please help are more than 400 songs that do not want to hear who are wi

    Plawexki wrote:
    ...  do you know if the contacts, photos, messages etc will be wiped?
    Yes... Everything will be Wiped and Replaced with what is currently on Your Mac.
    SYNCING with iTunes
    See here  >  http://support.apple.com/kb/HT1386
    From Here  >  http://www.apple.com/support/iphone/syncing/
    You may find this information of interest...
    Have a read here...
    https://discussions.apple.com/message/18409815?ac_cid=ha
    And See Here...
    How to Use Multiple iDevices with One Computer

  • Problem with SDO_relate when using polygons with holes.

    I'm having a problem with sdo_relate. I'm trying to extract all elements from a point table (bdtq_batim_p) that are inside a specific polygon from another table (SDA_MUNIC_SS). The spatial index for both table have been rebuilt and the data from both table is valid.
    When I do a count on the query, I know the answer should be 1422 elements (Counted in ArcGIS). However, sdo_relate gives a smaller number of elements in the result set.
    The query :
    SELECT count(distinct t.identifiant) FROM bdtq_batim_p t, SDA_MUNIC_SS s WHERE s.mus_co_geo = '48015' and sdo_relate( t.SHAPE,s.SHAPE,'mask=anyinteract querytype=window') = 'TRUE'
    returns 282 elements. The query with mask=inside, SDO_Anyinteract() and SDO_inside() all give the same result.
    I did a test with the following query and the result is 1422 (which is the good result).
    SELECT count(distinct t.identifiant) FROM bdtq_batim_p t, SDA_MUNIC_SS s WHERE s.mus_co_geo = '48015' and SDO_WITHIN_DISTANCE( t.SHAPE,s.SHAPE,'distance=0') = 'TRUE';
    It's important to note that the polygone (from SDA_MUNIC_SS) that is used for this query have holes in it. I have the same problem with all the polygons from the SDA_MUNIC_SS table that have holes in it. For the polygon without holes, the results are the same for the 2 queries.
    My question are :
    Why are the result from the two queries different? A query with a buffer of 0 should always return the same result as a query with Anyinteract.
    Is there a known problem with SDO_RELATE when using a polygon with holes in it?
    Do you have any idea how to solve my problem.

    Since i don't have much control on the version of Oracle and Patches that we use in the system, we used a workaround that detects the polygons with holes and uses the SDO_WITHIN_DISTANCE( t.SHAPE,s.SHAPE,'distance=0') = 'TRUE' operator in those case. We saw a slight decline in performance but it now returns the right results. When the system will be patched, we'll come back to the original version and see if the problem is solved.

  • Problem with Folio Builder - added articles are "spinning"

    Hello,
    today we are experiencing strange problems with Folio Builder. We are adding new artcles to folio created today and all added articles have same issue - spinning wheel in folio builder. Such articles we can't see in Content viewer until we delete existing folio.
    Thanks for help

    Hi,
    Could be that there was a network problem when uploading the InDesign documents.
    Try to select the articles and delete them with the trashcan. And then reupload the documents from InDesign.
    Good luck!

  • Hi, recently purchased macbook 13", I have problem with sound when connect to my LG Smart tv with sound system. When i change sounds effect on my sound system also LG its all go quiet didn't have this problem with my laptop. Any advise ?

    Hi, recently purchased macbook 13", I have problem with sound when connect to my LG Smart tv with sound system. When i change sounds effect on my sound system also LG its all go quiet didn't have this problem with my laptop. Any advise ?

    Some progess I see. To be honest, i would not waste your time with trying to connect using wireless.
    You are likely to get poor connections and dropping out.
    If its working using a cable, then there is no need to bother with giving me the network settings, bu see how it goes, because sometimes giving the TV a static IP address can give better results.
    There is an example of a couple of powerline adapters on the diagram below. Just ignore the network switch unless you want to connect other devices which are near to the TV.
    http://forumhelp.dyndns.info/networking/powerline3.jpg
    I will monitor the subject line of this thread, should you want to post any more information.
    There are some useful help pages here, for BT Broadband customers only, on my personal website.
    BT Broadband customers - help with broadband, WiFi, networking, e-mail and phones.

  • Canon pixma pro 9500 having problems with my print out. colors are glazed and missing colors

    canon pixma pro 9500 having problems with my print out. colors are glazed and missing colors
    i have prfiled the mac and printer wiht colormunki and uplodated the profile sucessfully
    i set the printer to correct icc profile
    print out comes out same with glazed colors and missing tones/colors
    however when i use the same printer on windows and with light room, following same icc profile, colormunki calibrated profile, the print our are excellent.
    i have also tried using printer manage profile using the Mac and Aperture and get same poor prints
    can  you please assist and thanks

    I've a Pro9000 and also use Colormunki successfully.
    When I use Colormunki, I calibrate both of my monitors and the printer/paper combination. Colormunki saves the generated profiles to the correct places -- I don't load or change any profiles after that as that would mess-up what the Colormunki had just done for me, and this would likely mess-up the prints.
    Though I double-check the settings in the print dialogue, the choice for the printer handling things is already grayed-out. Colorsync handles it all just fine.

  • I have problems with Gmail when I open it in Firefox. The button "write a letter" doesn't work

    Dear Firefox team,
    I have problems with Gmail when I open it in Firefox. The button "write a letter" doesn't work. On the page it is seen as if the page is being downloaded but in fact not. As a result, I can't neither write new letters no reply to received mail.
    Best regards,
    Alla Khv

    -> If images are missing then check that you aren't blocking images from some domains. See:
    http://kb.mozillazine.org/Images_or_animations_do_not_load
    -> Check the permissions for the domain in the current tab in Tools > Page Info > Permissions
    -> Check that images are enabled: Tools > Options > Content: [X] Load images automatically
    -> Check the exceptions in Tools > Options > Content: Load Images > Exceptions
    -> Check the "Tools > Page Info > Media" tab for blocked images (scroll through all the images)
    -> There are also extensions (Tools > Add-ons > Extensions) that can block images.
    Troubleshooting extensions and themes
    https://support.mozilla.com/en-US/kb/Troubleshooting%20extensions%20and%20themes
    Check and tell if its working.

  • Problems with navigation when deploy application on WebLogic 10.3

    Hi! I have problems with navigation when I deploy my application on Weblogic server 10.3. In my application I have two pages. One page where I can see the records. In this page I have button Create with action to secound jspx page. When I press this button then the first form (where I could see all records) is empty - the create operation worked, but navigation to second page not. Navigation rules is in adf task flow. In default server all works correct. Where is the problem?
    Maybe when I deploy my application I need specialy deploy adf task flow or somewhere write something? If so, then can you explain me where? Any suggestions what to do.
    Best regards!

    I have in log:
    2009.26.3 20:12:52 oracle.adfinternal.controller.faces.lifecycle.JSFLifecycleImp
    l setLifecycleContextBuilder
    WARNING: ADFc: Replacing the ADF Page Lifecycle implementation with 'oracle.adfi
    nternal.controller.application.model.JSFDataBindingLifecycleContextBuilder'.
    2009.26.3 20:12:52 oracle.adfinternal.controller.util.model.AdfmInterface initia
    lize
    INFO: ADFc: BindingContext is present, using ADFm APIs for DataControlFrames.
    2009.26.3 20:12:52 oracle.adfinternal.controller.metadata.provider.MdsMetadataRe
    sourceProvider <init>
    INFO: ADFc: Controller caching of MDS metadata resources ENABLED.
    2009.26.3 20:12:52 oracle.adf.controller.internal.metadata.MetadataService$Boots
    trap add
    INFO: ADFc: Loading bootstrap metadata from '/WEB-INF/adfc-config.xml'.
    2009.26.3 20:12:54 oracle.adf.share.security.providers.jps.CSFCredentialStore fe
    tchCredential
    WARNING: Unable to locate the credential for key AUGI in D:\bea\user_projects\do
    mains\base_domain\config\oracle.
    2009.26.3 20:12:54 oracle.adf.share.jndi.ReferenceStoreHelper throwPartialResult
    Exception
    WARNING: Incomplete connection information
    Edited by: Debuger on Mar 26, 2009 11:18 AM

  • When attempting to use Lightroom external editor program to edit a photo in Photoshop Elements 10, the photo does not open / appear on photoshop elements screen.  I don't have any problem with this when using Photoshop Elements 6 or Photoshop CS.  I'm usi

    When attempting to use Lightroom external editor program to edit a photo in Photoshop Elements 10, the photo does not open / appear on photoshop elements screen.  I don't have any problem with this when using Photoshop Elements 6 or Photoshop CS.  I'm using a Mac with Mountain Lion OS.  Any solutions?

    Adobe now hides the editor - what looks like it is not - you want the editor hidden in the support folder - see http://forums.adobe.com/message/3955558#3955558 for details
    LN

  • F-32 : Problem with Open Item selection

    Hi,
    We have a strange problem with open Item selection for customer clearing in t-code F-32
    In My QA system
    if I input spl GL indicator ="*" and uncheck Normal OI tick,
    the system selects all open items,
    (those with spl GL indicator and those without spl GL indicator)
    In My Dev system
    If I input spl GL indicator ="*" and uncheck Normal OI tick
    the system does not select any open items,
    Please let me know which setting controls this behaviour ?
    Regards
    Sachin

    Hello,
    Check your data in FBL5N for the option "Special GL Transactions". There could be that there is no data in the system with SPECIAL GL TRANSACTIONS.
    In F-32, there is no value like *
    You need to input right Special GL Indicator. "*" will not work here.
    I am sure in both the systems if you put "*" and UNTICK your normal transaction, you will NOT get any items to clear.
    Please DOUBLE CHECK whether you have unticked normal transaction.
    Regards,
    Ravi

Maybe you are looking for

  • ADVC-100 Capturing...

    Hello all, Yes, yes another question from Benny P. Now that I've finished my most recent project in the DV format, I am now swooped into my next project. This time using Analog footage (WHY?). I asked a question not too long ago and was told I needed

  • Some of my pictures and videos are disappearing, anyone ever had that issue?

    Why are some of my pictures and videos disappearing? where re can go to access my photos and videos that I backed up on Icloud?

  • Workflow goes into error

    There is an invoice approval via workflow. Task is a foreground task(dialog method) and user gets a screen where he has options to approve/reject/ see the docu. Data has been passed to the task container via wf-task binding. task is using a method of

  • Show View Options Settings

    Hello, On your Desktop and in Finder, you can Right Click and then you have an option called Show View Options. I notice if I can my icon and text sizes for files and folders within Finder, but when you change it, it only changes it for what you are

  • Ix2-dl won't start up

    Recently took out a single 1gig WD drive from my ix2-dl and replaced it with a new 2gig WD red drive. Original drive was working fine. New drive won't work. I end up with a solid blue light and flashing red light over and over. I have CLEANed the dri