Page 1 of 1

Parameter out of Range

Posted: Sun Apr 08, 2012 3:41 pm
by Weizen
L2J Revision Number: 5226


HI

i wanted to add a "score" system and added it everywhere on the l2pcinstance also on the characters table

everything works fine...just i cant create a char

here the error log:

Code: Select all

Could not insert char data: Parameter index out of range (38 > number of parameters, which is 37).java.sql.SQLException: Parameter index out of range (38 > number of parameters,which is 37).        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)        at com.mysql.jdbc.PreparedStatement.checkBounds(PreparedStatement.java:3729)        at com.mysql.jdbc.PreparedStatement.setInternal(PreparedStatement.java:3713)        at com.mysql.jdbc.PreparedStatement.setInternal(PreparedStatement.java:3755)        at com.mysql.jdbc.PreparedStatement.setDate(PreparedStatement.java:3631)         at com.mysql.jdbc.PreparedStatement.setDate(PreparedStatement.java:3600)         at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.setDate(NewProxyPreparedStatement.java:937)        at com.l2jserver.gameserver.model.actor.instance.L2PcInstance.createDb(L2PcInstance.java:7545)        at com.l2jserver.gameserver.model.actor.instance.L2PcInstance.create(L2PcInstance.java:1207)        at com.l2jserver.gameserver.network.clientpackets.CharacterCreate.runImpl(CharacterCreate.java:184)        at com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:62)        at com.l2jserver.gameserver.network.L2GameClient.run(L2GameClient.java:1095)        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)        at java.lang.Thread.run(Unknown Source) 
well this " Could not insert char data: Parameter index out of range (38 > number of paramet
ers, which is 37). on the pc instance there 38 parameters not 37 why it dont create?


thanks for help and sorry for my english

Re: Parameter out of Range

Posted: Sun Apr 08, 2012 6:10 pm
by Zoey76
private static final String INSERT_CHARACTER = "INSERT INTO characters (account_name,charId,char_name,level,maxHp,curHp,maxCp,curCp,maxMp,curMp,face,hairStyle,hairColor,sex,exp,sp,karma,fame,pvpkills,pkkills,clanid,race,classid,deletetime,cancraft,title,title_color,accesslevel,online,isin7sdungeon,clan_privs,wantspeace,base_class,newbie,nobless,power_grade,createDate) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
You will need to update UPDATE_CHARACTER and RESTORE_CHARACTER too.

Re: Parameter out of Range

Posted: Mon Apr 09, 2012 4:32 am
by Weizen
Ups i dont add a ?

Damm and searched so long...at the end it was just two letters that missing... ",?"


Thank you Zoey its nice to learn something