@ -9,11 +9,14 @@
@@ -9,11 +9,14 @@
package engine.db.handlers ;
import engine.objects.PreparedStatementShared ;
import engine.gameManager.DbManager ;
import engine.powers.EffectsBase ;
import org.pmw.tinylog.Logger ;
import java.sql.Connection ;
import java.sql.PreparedStatement ;
import java.sql.ResultSet ;
import java.sql.SQLException ;
import java.util.ArrayList ;
public class dbEffectsBaseHandler extends dbHandlerBase {
@ -22,24 +25,24 @@ public class dbEffectsBaseHandler extends dbHandlerBase {
@@ -22,24 +25,24 @@ public class dbEffectsBaseHandler extends dbHandlerBase {
}
public static ArrayList < EffectsBase > getAllEffectsBase ( ) {
PreparedStatementShared ps = null ;
ArrayList < EffectsBase > out = new ArrayList < > ( ) ;
try {
ps = new PreparedStatementShared ( "SELECT * FROM static_power_effectbase ORDER BY `IDString` DESC" ) ;
ResultSet rs = ps . executeQuery ( ) ;
ArrayList < EffectsBase > effectList = new ArrayList < > ( ) ;
try ( Connection connection = DbManager . getConnection ( ) ;
PreparedStatement prepareStatement = connection . prepareStatement ( "SELECT * FROM static_power_effectbase ORDER BY `IDString` DESC" ) ) {
ResultSet rs = prepareStatement . executeQuery ( ) ;
while ( rs . next ( ) ) {
EffectsBase toAdd = new EffectsBase ( rs ) ;
out . add ( toAdd ) ;
effectLis t. add ( toAdd ) ;
}
rs . close ( ) ;
} catch ( Exception e ) {
Logger . error ( e ) ;
} finally {
ps . release ( ) ;
} catch ( SQLException e ) {
Logger . error ( e . toString ( ) ) ;
}
//testHash(out);
return ou t;
return effectList ;
}
}