Skip to content

PetNameTable ( again )

Featured Replies

Tryskell I was sure that your answer on last topic was the right one.......but it wasn't after compiling it remained the same, check the error.....

 

Dec 24, 2017 4:20:23 AM com.l2jserver.gameserver.data.sql.impl.PetNameTable doesPetNameExist
WARNING: PetNameTable: Could not check existing petname:No value specified for parameter 1
java.sql.SQLException: No value specified for parameter 1
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:545)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:513)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:505)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:479)
    at com.mysql.cj.jdbc.PreparedStatement.checkAllParametersSet(PreparedStatement.java:2159)
    at com.mysql.cj.jdbc.PreparedStatement.fillSendPacket(PreparedStatement.java:2139)
    at com.mysql.cj.jdbc.PreparedStatement.fillSendPacket(PreparedStatement.java:2076)
    at com.mysql.cj.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1901)
    at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
    at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)
    at com.l2jserver.gameserver.data.sql.impl.PetNameTable.doesPetNameExist(PetNameTable.java:45)
    at com.l2jserver.gameserver.network.clientpackets.RequestChangePetName.runImpl(RequestChangePetName.java:70)
    at com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:69)
    at com.l2jserver.gameserver.network.L2GameClient.run(L2GameClient.java:1135)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

 

any ideas :/ ? still can't name freaking pet...............

Solved by Tryskell

  • Author
9 hours ago, melron said:

Try to understand the following images

 

5iydJSW.jpg

 

WgJVOF8.jpg

man, look I did it like that...................

 

 

Unbenannt.jpg

  • Author
Just now, melron said:

Then you didnt compile or you didnt update the jar

I did compile and I updated the jar

  • Author
Just now, melron said:

do it again :)

I've done it man....I am not joking.... but it brings this error all the time

  • Author
1 minute ago, melron said:

do it again :)

and inside the game it says that " this pet name already exists ".....

Just now, milosvamp said:

I've done it man....I am not joking.... but it brings this error all the time

just do it again man. one more time do it

  • Author
2 minutes ago, melron said:

just do it again man. one more time do it

but why...............it will be the same man...................

  • Author
6 hours ago, melron said:

just do it again man. one more time do it

OK I've did it again, and got same error. What now ?

  • Solution

aCis version is as following (the query is the same) :

	private static boolean doesPetNameExist(String name)
	{
		boolean result = true;
		try (Connection con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement ps = con.prepareStatement(SEARCH_NAME))
		{
			ps.setString(1, name);
			
			final ResultSet rs = ps.executeQuery();
			result = rs.next();
			rs.close();
		}
		catch (SQLException e)
		{
			_log.log(Level.SEVERE, "Couldn't check existing petname.", e);
		}
		return result;
	}

If it doesn't fix it, verify than "name" is correctly set. If nothing works, sorry, but there is no logic, so no answer possible. Most probably you don't refresh the jar correctly, or edit the one of another server installation by error.

  • Author
15 hours ago, Tryskell said:

aCis version is as following (the query is the same) :


	private static boolean doesPetNameExist(String name)
	{
		boolean result = true;
		try (Connection con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement ps = con.prepareStatement(SEARCH_NAME))
		{
			ps.setString(1, name);
			
			final ResultSet rs = ps.executeQuery();
			result = rs.next();
			rs.close();
		}
		catch (SQLException e)
		{
			_log.log(Level.SEVERE, "Couldn't check existing petname.", e);
		}
		return result;
	}

If it doesn't fix it, verify than "name" is correctly set. If nothing works, sorry, but there is no logic, so no answer possible. Most probably you don't refresh the jar correctly, or edit the one of another server installation by error.

Yes, I understand, on other project it works, thank you. But at this project what I wanted to fix it doesn't work at all, no idea why... Thank you very much for your help. This topic can be locked now....

25 minutes ago, milosvamp said:

his topic can be locked now....

 

  • melron locked this topic
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.