Fixed.
This is a discussion on (Xypher) Column Count doesnt match. MapleCharacter within the Help forums, part of the Java Based (Odin) category; Fixed....
Fixed.
Last edited by FrostByte; 22-08-12 at 02:27 AM.
Does anyone know how to fix this? I have same problem?
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.
I dont get that, someone else said that but can u explain more please? Or tell me where to go?
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.
in the above the ? will be replaced with the value of shopId, from the ps.setInt(1,shopId) line.Code:ps = con.prepareStatement("SELECT * FROM shopranks WHERE shopid = ? ORDER BY rank ASC"); ps.setInt(1, shopId); rs = ps.executeQuery();
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.
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
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.
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?
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.
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?
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.
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
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.
This is my error
View image: problem
Would you know which 1?
your error is in client.inventory.itemloader.saveitems().
Java is not a programming language - It's a sanity test.