when i call this function gives me error like this.
i tried both functions
ResultSet result = statement.executeUpdate();
and
ResultSet result = statement.executeQuery();
and same reaction on both scropts
Oct 13, 2012 9:45:18 PM com.l2jserver.gameserver.communitybbs.Manager.BuffBBSManager showBuffMainPage
WARNING: Could get data from character:
java.sql.SQLException: Can not issue executeUpdate() for SELECTs
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1074)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:988)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:974)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2412)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2371)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2355)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:477)
at com.l2jserver.gameserver.communitybbs.Manager.BuffBBSManager.showBuffMainPage(BuffBBSManager.java:129)
at com.l2jserver.gameserver.communitybbs.Manager.BuffBBSManager.parsecmd(BuffBBSManager.java:38)
at com.l2jserver.gameserver.communitybbs.CommunityBoard.handleCommands(CommunityBoard.java:59)
at com.l2jserver.gameserver.network.clientpackets.RequestBypassToServer.runImpl(RequestBypassToServer.java:234)
at com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:60)
at com.l2jserver.gameserver.network.L2GameClient.run(L2GameClient.java:1073)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
private void showBuffMainPage(L2PcInstance activeChar)
{
try(Connection con = L2DatabaseFactory.getInstance().getConnection())
{
PreparedStatement statement = con.prepareStatement("SELECT * FROM character_bbs_buff_save WHERE charId=?");
statement.setInt(1, activeChar.getObjectId());
ResultSet result = statement.executeUpdate();
TextBuilder html = new TextBuilder();
html.append("<table width=220>");
while (result.next())
{
String name = result.getString("scheme_name");
html.append("<tr>");
html.append("<td>");
if (name.equals(null))
{
html.append("No Scheme");
}
else
{
html.append("<button value=\"" + name + "\" action=\"bypass _bbsbuff;use;" + name + "\" width=190 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">");
}
html.append("</td>");
html.append("</tr>");
}
html.append("</table>");
result.close();
statement.close();
String content = HtmCache.getInstance().getHtmForce(activeChar.getHtmlPrefix(), "data/html/CommunityBoard/buffer.htm");
content = content.replace("%scheme_list%", html.toString());
separateAndSend(content, activeChar);
}
catch (Exception e)
{
_log.log(Level.WARNING, "Could get data from character: ", e);
}
}
DISCORD :
utchiha_market
telegram :
https://t.me/utchiha_market
SELLIX STORE :
https://utchihamkt.mysellix.io/
Join our server for more products :
https://discord.gg/hood-services
https://campsite.bio/utchihaamkt
Xmas Wolf Chariot Mount | Lineage 2 Mod
Celebrate the holiday spirit in Lineage 2 with this festive Xmas Wolf Chariot Mount! Created for protocol 166, this unique modification features majestic wolf mounts with holiday-themed harnesses pulling a decorative chariot.
If you have questions or want to add this updated skill to your game, feel free to contact me via Skype or Discord.
Download or in Discord Client Dev channel https://discord.gg/XdCb9dmTtf
Question
janiko
when i call this function gives me error like this.
i tried both functions
ResultSet result = statement.executeUpdate();
and
ResultSet result = statement.executeQuery();
and same reaction on both scropts
2 answers to this question
Recommended Posts