0
I’m a beginner in java, I made an application using the netbeans native database.
Gero the file jar
, and in the machine I made the application the jar
runs normally, but when I put this jar on another machine it just opens, plus when it arrives at the part that makes the connection in the bank (example when I click the sign up button, the register, and not even list) it just doesn’t open.
I wonder how I do to run on another machine, like it was done on windows 10, and want to run on windows 7.
Welcome to Stack Overflow! For the community to help you, it’s important to explain your problem in detail. It would be interesting to attach an Error Log to make it easier! I suggest you read the articles: Tour and how to ask a question.
– Thiago Luiz Domacoski
How are you making the connection and how does the bank generate in the app? Add the code there, netbeans creates a local only connection to your computer, the Uri will be invalid in another.
– user28595
public class Dao {
 // private static List<Usuario> banco = new LinkedList<Usuario>();
 EntityManagerFactory emf= Persistence.createEntityManagerFactory("Aplica__oPU");
 EntityManager em =emf.createEntityManager();
 EntityTransaction etx = em.getTransaction();
– Enderson Cesar
public void salve(Object o){ etx.Begin(); em.merge(o); etx.commit(); } public remover(Object o){ etx.Begin(); em.remove(o); etx.commit(); } public List list list(The){ Query q = in.createQuery("SELECT the FROM "+o.getSimpleName()+" the"); Return q.getResultList(); }
– Enderson Cesar
I don’t know if I can understand it, but this is the code I use to connect to the database, and I use a class percistencia.xml
– Enderson Cesar
@Endersoncesar, could you update your question with the connection parameters you use? Most likely you are connecting on localhost (because you are developing on your machine). When you distribute your application, you need to switch localhost to the IP (or DNS) of the machine where the database is located.
– cantoni
hello I’m using the path, jdbc://debylocalhost:1127/sample[app in APP], this is the path of the bank in my machine, but I’m trying to run the jar in just a machine, I have to change this path?
– Enderson Cesar