I am stuck. This is the code so far. It does not work.
billede means Image
fis.setBillede(bille); needs to make it a Serializable not FileInputStream
Code
public void savebillede()
{
EntityManagerFactory factory = Persistence.createEntityManagerFactory("Contact DB");
EntityManager em = factory.createEntityManager();
em.getTransaction().begin();
Gtspiller fis = em.find(Gtspiller.class, 1);
File image = new File("C:\\portrait\\monkey.gif");
FileInputStream bille = null;
bille = new FileInputStream(image);
fis.setBillede(bille);
em.getTransaction().commit();
em.close();
}
Its probably very simple. Think I have to Somehow convert the image to an byte[] first
Thanks