Welcome to the RaGEZONE - MMORPG development forums.

(Xypher) Column Count doesnt match. MapleCharacter

This is a discussion on (Xypher) Column Count doesnt match. MapleCharacter within the Help forums, part of the Java Based (Odin) category; Fixed....

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Member
    Rank
    Member
    Join Date
    Aug 2012
    Posts
    55
    Liked
    0

    (Xypher) Column Count doesnt match. MapleCharacter

    Fixed.
    Attached Thumbnails Attached Thumbnails untitleddasd.png  
    Last edited by FrostByte; 22-08-12 at 02:27 AM.

  2. #2
    Member
    Rank
    Member
    Join Date
    Jun 2012
    Posts
    94
    Liked
    0

    Re: (Xypher) Column Count doesnt match. MapleCharacter

    Does anyone know how to fix this? I have same problem?

  3. #3
    Contented
    Rank
    Member +
    Join Date
    Apr 2008
    Posts
    386
    Liked
    41

    Re: (Xypher) Column Count doesnt match. MapleCharacter

    Its probably on the save to db routine.
    The number of '?' in the prepared statement doesn't match the number of set statements.
    Java is not a programming language - It's a sanity test.

  4. #4
    Member
    Rank
    Member
    Join Date
    Jun 2012
    Posts
    94
    Liked
    0

    Re: (Xypher) Column Count doesnt match. MapleCharacter

    I dont get that, someone else said that but can u explain more please? Or tell me where to go?

  5. #5
    Contented
    Rank
    Member +
    Join Date
    Apr 2008
    Posts
    386
    Liked
    41

    Re: (Xypher) Column Count doesnt match. MapleCharacter

    I will try and explain, as opposed to telling you where to go :)

    In the preparedstatements the '?' is used as a place marker for a value.
    Code:
                ps = con.prepareStatement("SELECT * FROM shopranks WHERE shopid = ? ORDER BY rank ASC");
                ps.setInt(1, shopId);
                rs = ps.executeQuery();
    in the above the ? will be replaced with the value of shopId, from the ps.setInt(1,shopId) line.

    If the number of '?' does not match exactly the number of ps.setxxx() statements you get your error. (xxx can be Int,Short,String etc)

    See what the highest number is in the ps.setxxx() statements, and then count the number of '?' in the line.

    They should match.
    Java is not a programming language - It's a sanity test.

  6. #6
    Member
    Rank
    Member
    Join Date
    Jun 2012
    Posts
    94
    Liked
    0

    Re: (Xypher) Column Count doesnt match. MapleCharacter

    Hey Dich can you add my msn if you have itzmejesse@hotmail.com
    if not
    ps.setxxx() do i look at that in savetodb? (And i think i know where it is but where is savetodb located, is it in a file? like maplecharacter.java?)

    Also what does the ps.setxxx() have to match? o-0

  7. #7
    Contented
    Rank
    Member +
    Join Date
    Apr 2008
    Posts
    386
    Liked
    41

    Re: (Xypher) Column Count doesnt match. MapleCharacter

    yes in maplecharacter.

    I don't use msn so no can add.

    if there are ps.setxxx(1,..) to ps.setxxx(30,...) then there must be 30 '?' in the preparestatement.
    Java is not a programming language - It's a sanity test.

  8. #8
    Member
    Rank
    Member
    Join Date
    Jun 2012
    Posts
    94
    Liked
    0

    Re: (Xypher) Column Count doesnt match. MapleCharacter

    where is preparestatement?

    and to get this clear, i will find exactly ps.setxxx(#) in savetodb? i look at the ? and that im not sure what to do with that? o-0 the preparestatement?

  9. #9
    Contented
    Rank
    Member +
    Join Date
    Apr 2008
    Posts
    386
    Liked
    41

    Re: (Xypher) Column Count doesnt match. MapleCharacter

    This is part of my file it shows what you should be looking for.
    Code:
                ps = con.prepareStatement("UPDATE characters SET level = ?, fame = ?, str = ?, dex = ?, luk = ?, `int` = ?, exp = ?, hp = ?, mp = ?, maxhp = ?, maxmp = ?, sp = ?, ap = ?, gm = ?, skincolor = ?, gender = ?, job = ?, hair = ?, face = ?, demonMarking = ?, map = ?, meso = ?, hpApUsed = ?, spawnpoint = ?, party = ?, buddyCapacity = ?, pets = ?, subcategory = ?, marriageId = ?, currentrep = ?, totalrep = ?, gachexp = ?, fatigue = ?, charm = ?, charisma = ?, craft = ?, insight = ?, sense = ?, will = ?, totalwins = ?, totallosses = ?, pvpExp = ?, pvpPoints = ?, reborns = ?, apstorage = ?, name = ? WHERE id = ?", DatabaseConnection.RETURN_GENERATED_KEYS);
                ps.setInt(1, level);
                ps.setInt(2, fame);
                ps.setShort(3, stats.getStr());
                ps.setShort(4, stats.getDex());
                ps.setShort(5, stats.getLuk());
                ps.setShort(6, stats.getInt());
                ps.setInt(7, (level >= 200 || (GameConstants.isKOC(job) && level >= 120)) && !isIntern() ? 0 : exp);
                ps.setInt(8, stats.getHp() < 1 ? 50 : stats.getHp());
                and on and on and on......
    Java is not a programming language - It's a sanity test.

  10. #10
    Member
    Rank
    Member
    Join Date
    Jun 2012
    Posts
    94
    Liked
    0

    Re: (Xypher) Column Count doesnt match. MapleCharacter

    So do I count the
    maxhp = ?, maxmp = ?, sp = ?, ap
    and all of them? The ones that have ?
    OR do you mean I look at maplecharacter save to DB and then see ps.setxxx(#) then compare those ?'s to the ones here?
    maxhp=?

    And is the preparestatement located in maplecharacter? Where the savetodb is?

  11. #11
    Contented
    Rank
    Member +
    Join Date
    Apr 2008
    Posts
    386
    Liked
    41

    Re: (Xypher) Column Count doesnt match. MapleCharacter

    yes the ? are what you need to count, There should be the same number as the number of set statements.
    (if it is a new char not being saved, then in may be in another routine towards the top of the maplecharacter file, but again the ? and set's must match)
    Java is not a programming language - It's a sanity test.

  12. #12
    Member
    Rank
    Member
    Join Date
    Jun 2012
    Posts
    94
    Liked
    0

    Re: (Xypher) Column Count doesnt match. MapleCharacter

    Alright ill go see and just one more question,

    Im in maplecharacter.java and i go to savetodb and look for ps.setxxx (and should there be just a number there?)
    Sorry for all these questions

  13. #13
    Contented
    Rank
    Member +
    Join Date
    Apr 2008
    Posts
    386
    Liked
    41

    Re: (Xypher) Column Count doesnt match. MapleCharacter

    There should be a number and a value on each pset ie ps.psetxxx(number,value), the number is the corresponding '?' in the preparestatement.
    (If you looked at the error message it would tell you which prepareStatement it didn't like)
    Last edited by Dichotome; 22-08-12 at 12:00 AM. Reason: made clearer
    Java is not a programming language - It's a sanity test.

  14. #14
    Member
    Rank
    Member
    Join Date
    Jun 2012
    Posts
    94
    Liked
    0

    Re: (Xypher) Column Count doesnt match. MapleCharacter

    This is my error
    View image: problem
    Would you know which 1?

  15. #15
    Contented
    Rank
    Member +
    Join Date
    Apr 2008
    Posts
    386
    Liked
    41

    Re: (Xypher) Column Count doesnt match. MapleCharacter

    your error is in client.inventory.itemloader.saveitems().
    Java is not a programming language - It's a sanity test.

 

 
Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •