question: private void initialiseTables ( ) throws SQLException { try ( Statement st = sqlConnection . createStatement ( ) ) { st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "achievements (playername char(36),achievement varchar(64),description varchar(128),date DATE,PRIMARY KEY (playername, achievement))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "breaks (playername char(36),blockid varchar(32),breaks INT,PRIMARY KEY(playername, blockid))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "places (playername char(36),blockid varchar(32),places INT,PRIMARY KEY(playername, blockid))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "kills (playername char(36),mobname varchar(32),kills INT,PRIMARY KEY (playername, mobname))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "crafts (playername char(36),item varchar(32),crafts INT,PRIMARY KEY (playername, item))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "deaths (playername char(36),deaths INT,PRIMARY KEY (playername))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "arrows (playername char(36),arrows INT,PRIMARY KEY (playername))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "snowballs (playername char(36),snowballs INT,PRIMARY KEY (playername))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "eggs (playername char(36),eggs INT,PRIMARY KEY (playername))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "fish (playername char(36),fish INT,PRIMARY KEY (playername))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "itembreaks (playername char(36),itembreaks INT," + "PRIMARY KEY (playername))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "eatenitems (playername char(36),eatenitems INT,PRIMARY KEY (playername))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "shears (playername char(36),shears INT,PRIMARY KEY (playername))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "milks (playername char(36),milks INT,PRIMARY KEY (playername))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "connections (playername char(36),connections INT,date varchar(10),PRIMARY KEY (playername))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "trades (playername char(36),trades INT,PRIMARY KEY (playername))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "anvils (playername char(36),anvils INT,PRIMARY KEY (playername))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "enchantments (playername char(36),enchantments INT,PRIMARY KEY (playername))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "levels (playername char(36),levels INT,PRIMARY KEY (playername))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "beds (playername char(36),beds INT,PRIMARY KEY (playername))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "consumedpotions (playername char(36),consumedpotions INT,PRIMARY KEY (playername))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "playedtime (playername char(36),playedtime BIGINT,PRIMARY KEY (playername))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "distancefoot (playername char(36),distancefoot INT,PRIMARY KEY (playername))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "distancepig (playername char(36),distancepig INT,PRIMARY KEY (playername))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "distancehorse (playername char(36),distancehorse INT,PRIMARY KEY (playername))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "distanceminecart (playername char(36),distanceminecart INT,PRIMARY KEY (playername))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "distanceboat (playername char(36),distanceboat INT,PRIMARY KEY (playername))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "distancegliding (playername char(36),distancegliding INT,PRIMARY KEY (playername))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "drops (playername char(36),drops INT,PRIMARY KEY (playername))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "hoeplowing (playername char(36),hoeplowing INT,PRIMARY KEY (playername))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "fertilising (playername char(36),fertilising INT,PRIMARY KEY (playername))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "tames (playername char(36),tames INT,PRIMARY KEY (playername))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "brewing (playername char(36),brewing INT,PRIMARY KEY (playername))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "fireworks (playername char(36),fireworks INT,PRIMARY KEY (playername))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "musicdiscs (playername char(36),musicdiscs INT,PRIMARY KEY (playername))" ) ; st . addBatch ( "CREATE TABLE IF NOT EXISTS " + tablePrefix + "enderpearls (playername char(36),enderpearls INT,PRIMARY KEY (playername))" ) ; st . executeBatch ( ) ; } }
target:  Initialise database tables by creating non existing ones. We batch the requests to send a unique batch to the database.