I have a .properties file to set up the bank for my project. But I can not read the file.
Does anyone give a force?
EntityManagerProducer
@ApplicationScoped
public class EntityManagerProducer {
private EntityManagerFactory factory;
public EntityManagerProducer() throws FileNotFoundException, IOException {
Properties p = new Properties();
p.load(new FileInputStream("./conexao.properties"));
factory = Persistence.createEntityManagerFactory("AlmoxarifadoPU");
}
@Produces @RequestScoped
public EntityManager createEntityManager() {
return factory.createEntityManager();
}
public void closeEntityManager(@Disposes EntityManager manager) {
manager.close();
}
Properties file
jdbc.user=root
jdbc.password=
jdbc.url=jdbc:mysql://localhost/almoxarifadome"
jdbc.driver=com.mysql.jdbc.Driver