Jar file does not execute with DB connection

醉酒当歌 提交于 2019-12-25 17:01:27

问题


I'm building a project with Derby DB It works just fine when I run it in Netbeans and also as jar file when I use DB as Network Client with derbyclient.jar. But the problem is I have to distribute it so I use Embedded mode of Derby DB, As I provide derby.jar. And followed the instructions Provided Here. The only deference between Embedded & Network is we have to use this DB path (short DB name path)

dbPath = "jdbc:derby:Mail_Client_Ref_Fiverr";

Instead of (full with localhost and port)

dbPath = "jdbc:derby://localhost:1527/Mail_Client_Ref_Fiverr";

And in Class.forName (EmbeddedDriver)

Class.forName("org.apache.derby.jdbc.EmbeddedDriver");

Instead of (ClientDriver)

Class.forName("org.apache.derby.jdbc.ClientDriver");

But Its not working even on my own Laptop. I also tried it on my friend's laptop the problem is same.

I'm using Java 8u121 and its JavaFX project. Help me understand why its not working.

When I double-click on jar file it show a context manu with 3 options

  1. Java(TM) Platform SE binary
  2. Java Plateform SE binary
  3. WinRAR

In networking mode when I click on the 1st option above it works. But in Embedded mode it does not work at all.

Edit: When I execute with 1st option it through db connection error. With 2nd option it says unable to install java.

来源:https://stackoverflow.com/questions/42953665/jar-file-does-not-execute-with-db-connection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!