1

Sorry if this is a noob question. I made a project on netbeans. I connected it to my sql server online. When I use it on my computer, everything works I can check the database online and see that my new user was added. If I make the project into a jar, download it and try on another computer, it doesn't do anything and nothing was added to my table online. Is there something I'm missing? Thanks for any help.


edit for more details

I right clicked on databases, chose MySQL (Connector/ J Driver) for driver on netbeans. Then connected with my phpmyadmin credentials. If I add something to a list in the program on my computer, I can go onto phpmyadmin and see that it was added to the table. But if I create a jar and download it on another computer, the program doesn't add anything to the table.

Ponnarasu
  • 635
  • 1
  • 11
  • 24
  • Is it GUI or console program? And where do you put or display your error traces? – Young Emil Dec 10 '16 at 16:00
  • It's a gui and I use printStackTrace for exceptions. – Samantha Thomas Dec 10 '16 at 16:02
  • Are you connecting locally to a database or is it stored externally? – Sam Yuyitung Dec 10 '16 at 16:08
  • Did you check if the other computers are able to reach the db server? – Fabri Pautasso Dec 10 '16 at 16:10
  • @Samantha Thomas, So you can say your jar file runs well and is visible for you to interact with. Which means you are sure that from your program the data is been sent out of your program successfully through the `outputStream`? – Young Emil Dec 10 '16 at 16:16
  • I believe so. To add more details, I right clicked on databases, chose MySQL (Connector/ J Driver) for driver. Then connected with my phpmyadmin credentials. If I add something to a list in the program on my computer, I can go onto phpmyadmin and see that it was added to the table. But if I create a jar, download it on another computer, the program doesn't add anything to the table. – Samantha Thomas Dec 10 '16 at 16:21
  • 2
    Do you have any idea whether the `jar` file is built together with the `mysql java driver`? If you are not sure, check out how to use netbeans to build jar with external libraries on the internet or [this stackoverflow](http://stackoverflow.com/questions/10505057/netbeans-export-to-jar-include-all-library-files) page. – Young Emil Dec 10 '16 at 16:34
  • Sorry for the many questions though, just trying to be of help – Young Emil Dec 10 '16 at 16:52
  • That did the trick! Thanks so much Young Millie! – Samantha Thomas Dec 10 '16 at 17:24
  • You are welcome ! @Samantha Thomas, one thing: I have pasted that step as an answer to the question. So that Anytime someone visits this page, the person will know what answer worked. So you can `mark as best answer`,Thank you. – Young Emil Dec 10 '16 at 21:52

1 Answers1

0

Do you have any idea whether the jar file is built together with the mysql java driver? If you are not sure, check out how to use netbeans to build jar file with external libraries on the internet or this stackoverflow page.

Community
  • 1
  • 1
Young Emil
  • 2,220
  • 2
  • 26
  • 37
  • I have pasted that comment as an answer to the question. So that Anytime someone visits this page, the person will know which answer worked. Thank you. – Young Emil Dec 10 '16 at 21:58