/** * Select the image data from the database * * @param imageName the name of the image * @return <code>null</code> if no data was found * @throws Exception */ public ImageData selectImage(String imageName) throws Exception { ImageData imageData = new ImageData(imageName); fSelectImage.setString(1, imageName); ResultSet resultSet = fSelectImage.executeQuery(); try { while (resultSet.next()) { imageData.setUrl(resultSet.getString(1)); imageData.setFilename(resultSet.getString(2)); return imageData; } } finally { resultSet.close(); } return null; }