ResultSet rs = stmt.executeQuery("SELECT HashCode,LastUpdate,Format,Image FROM Tiles WHERE MapID=" + mapkey + " AND x=" + x + " AND y=" + y + " AND zoom=" + zoom + ";");
if (rs.next()) {
rslt = new TileRead();
rslt.hashCode = rs.getLong("HashCode");
rslt.lastModified = rs.getLong("LastUpdate");
<BUG>rslt.format = (rs.getInt("Format") == FMTIDX_PNG) ? ImageFormat.FORMAT_PNG : ImageFormat.FORMAT_JPG;
byte[] img = rs.getBytes("Image");</BUG>
rslt.image = new BufferInputStream(img);
}
rs.close();

ResultSet rs = stmt.executeQuery("SELECT HashCode,LastUpdate,Format,Image FROM Tiles WHERE MapID=" + mapkey + " AND x=" + x + " AND y=" + y + " AND zoom=" + zoom + ";");
if (rs.next()) {
rslt = new TileRead();
rslt.hashCode = rs.getLong("HashCode");
rslt.lastModified = rs.getLong("LastUpdate");
rslt.format = MapType.ImageEncoding.fromOrd(rs.getInt("Format"));
byte[] img = rs.getBytes("Image");
rslt.image = new BufferInputStream(img);
}
rs.close();
