public File getRessourceFile(int id)
	{
		String req;
		Statement st = null;
		ResultSet result;
		File f = null;
		
		try 
		{
			req = "SELECT * FROM t_medias WHERE id='"+id+"'";
			st = cnx();
			if(st == null) return null;
			
			result = st.executeQuery(req);
		    if(result.last() && result.getRow() == 1) 
		    {
			      String name = result.getString("name");
			      f = new File(System.getProperty("java.io.tmpdir")+File.separator+"name");
			      FileOutputStream fos = new FileOutputStream(f);

			      byte[] buffer = new byte[1];
			      InputStream is = result.getBinaryStream("binaryBlob");
			      while (is.read(buffer) > 0) 
			      {
			        fos.write(buffer);
			      }
			      fos.close();
		    }  
		    result.close();
		    st.close();
		} catch (SQLException | IOException e) 
		{
			e.printStackTrace();
		}
		return f;
	}