Page 1 of 1

Coding Question .

Posted: Sun Nov 04, 2012 8:48 pm
by gmakhs
The get.pet have change to get summon ?
how is now the close.con ?

anyone know what this possibly mean ?
[javac] Note: C:\Users\Cloud12\workspace\L2J_Server_BETA\java\com\l2jserver\gameserver\model\L2Nevit.java uses or overrides a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.

Re: Coding Question .

Posted: Sun Nov 04, 2012 10:48 pm
by UnAfraid
Just use ARM
Example:

Code: Select all

 try (Connection con = L2DatabaseFactory.getInstance();    PreparedStatement statement = con.prepareStatement("SELECT ?")){    statement.setInt(1, 1);    try (ResultSet rset = statement.executeQuery())    {        if (rset.next())        {             // ..        }    }}catch (SQLException e){    _log.log(Level.WARNING, "", e);}
And you will no longer need to use:

Code: Select all

finally{    L2DatabaseFactory.close(con);}

Re: Coding Question .

Posted: Thu Nov 08, 2012 5:07 pm
by gmakhs
thanks