Code example for PreparedStatement

Methods: addBatch, setBytes, setInt

0
		stat.close();
		ps.close();
	} 
 
	protected void writeTile(int x, int y, int z, byte[] tileData) throws SQLException, IOException {
		prepStmt.setInt(1, x);
		prepStmt.setInt(2, y);
		prepStmt.setInt(3, 17 - z);
		prepStmt.setBytes(4, tileData);
		prepStmt.addBatch();
	} 
 
	protected String getDatabaseFileName() {
		return "Custom " + atlas.getName() + ".sqlitedb"; 
	} 
 
	protected String getTileInsertSQL() {
		return INSERT_SQL;
	} 
 
}