Problem with sql

Find the proper support area, Saga-Version.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
User avatar
Bigi
Posts: 19
Joined: Sun Oct 16, 2011 9:37 pm

Problem with sql

Post by Bigi »

L2J Revision Number: L2J Interlude
L2JDP Revision Number: L2J Interlude

Hi all. I have a some problem with sql. Who can help?
How to write inquiry for loading from base of a variable for each character?

Sorry for my English :lol:
User avatar
Tryskell
Posts: 256
Joined: Wed Nov 25, 2009 5:57 pm
Location: France :)

Re: Problem with sql

Post by Tryskell »

Consider to give FAR more details, cause like that... It means nothing :P.

Gl anyway :P.
User avatar
Bigi
Posts: 19
Joined: Sun Oct 16, 2011 9:37 pm

Re: Problem with sql

Post by Bigi »

Tryskell wrote:Consider to give FAR more details, cause like that... It means nothing :P.

Gl anyway :P.
I need only code of loading a parameter from database. I want to load for each characters a parameter, which influences on a chance of level up of soul crystals. I want to place this code to L2Attackable.java


Sorry for my English :P
User avatar
Tryskell
Posts: 256
Joined: Wed Nov 25, 2009 5:57 pm
Location: France :)

Re: Problem with sql

Post by Tryskell »

There's a lot of exemples everywhere. Search for that sort of codes. And understand how work mySQL queries.

Code: Select all

        Connection con = null;        try        {            con = L2DatabaseFactory.getInstance().getConnection();            PreparedStatement statement = con.prepareStatement("write your SQL query here");            ResultSet result = statement.executeQuery();             while (result.next())            {                // Do your blabla here (based on your previous query, it must refer to each player)            }            result.close();            statement.close();        }        catch (Exception e)        {            _log.log(Level.SEVERE, "Error on blabla: ", e);        }        finally        {            try { con.close(); } catch (Exception e) {}        }
Post Reply