- 0
This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..
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
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); } }2 answers to this question
Recommended Posts