将derby数据库附加到jar文件中 [英] attach derby database into jar file

查看:144
本文介绍了将derby数据库附加到jar文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过数据库应用程序(SWING).我正在使用Java DB和NetBeans 7.1.2.在IDE中,如果我最初在服务"窗口中手动连接数据库,则该应用程序运行良好.另外,我已将derby.jar和derbyclient.jar文件添加到库中.但是,从"dist"文件夹运行该应用程序时,它无法连接到数据库.我想知道是否可以将db附加到jar文件中,以便可以从IDE外部运行该应用程序.谢谢.

I am midway through a database application(SWING). I am using Java DB and NetBeans 7.1.2. Within the IDE, the app runs good, provided I initially connect the database manually in the 'services' window. Also, I have added the derby.jar and derbyclient.jar files to the libraries. But when running the app from the "dist" folder, it fails to connect to the database. I want to know whether i can attach the db within the jar file so that i can run the app from outside the IDE. Thank you.

推荐答案

您可以执行以下操作

  • 在Netbeans外部启动java DB
  • 如果使用Derby,请使用Embedded mode.这样,您可以在没有单独的数据库服务器的情况下运行应用程序.
  • Start java DB outside the netbeans or
  • If you use Derby, go with Embedded mode. Such a way you can run your application without separate db server.

这篇关于将derby数据库附加到jar文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆