jar文件未连接到数据库 [英] jar file not connecting to the database

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

问题描述

我很久以前创建了一个Java项目,该项目需要连接到derby,后者是一个内置的netbeans数据库。我一直习惯于打开netbeans,编译文件并运行,它过去工作得很好。然后我学会了如何在netbeans上制作一个jar文件,并做到了。现在,当我运行jar文件时,它没有连接到数据库。当我登录时,它只是卡住了,原因显然是没有连接到db。谁能帮助我?预先感谢您。

i created a java project long back which requires connection to derby which is an inbuilt netbeans database. i always used to open netbeans, compile the files and run and it used to work just fine. then i learnt how to make a jar file out of it on netbeans and i did it.now when i run the jar file it does not connect to the database.when i login it just gets stuck up cause apparently is not connecting to db. could anyone plz help me out? Thanking you in advance.

P.S。请您的解释非常简单。我擅长编码,但不能理解很多编程术语。

P.S. Please be very simple in your explanation. I am good with coding but not in understanding a lot of programming jargon. try to explain me like a u would explain a layman if possible.

推荐答案

您正在使用ClientDriver,这意味着您的Java程序是尝试在端口1527上连接到同一台计算机( localhost)上运行的Derby Network Server。

You are using the ClientDriver, which means your Java program is attempting to connect to the Derby Network Server running on your same machine ("localhost") at port 1527.

如果该连接不起作用,最简单的解释是在运行Java程序时,Derby Network Server尚未运行。

If that connection is not working, the simplest explanation is that the Derby Network Server is not running at the moment that you run your Java program.

在Netbeans中运行的命令(转到Netbeans中的服务并连接)可能会会自动为您启动Derby Network Server。

The commands you are running in Netbeans ("Go To Services in Netbeans and Connect") may be automatically starting a Derby Network Server for you.

您可以自行启动Derby Network Server。这只是另一个Java程序; Derby二进制发行版包含一些可以运行以启动它的脚本。转到此处以了解如何启动Derby Network Server并对其进行配置,以使其知道您的Ayush数据库在哪里: http://db.apache.org/derby/docs/10.10/getstart/twwdactivity4.html 以及: http://db.apache.org/derby/docs/10.10/adminguide/cadminconfig86869.html#cadminconfig86869

You can start a Derby Network Server on your own. It's just another Java program; the Derby binary distribution contains some scripts that you can run to start it. Go here to read about how to start up the Derby Network Server and configure it so that it knows where your Ayush database is: http://db.apache.org/derby/docs/10.10/getstart/twwdactivity4.html and also: http://db.apache.org/derby/docs/10.10/adminguide/cadminconfig86869.html#cadminconfig86869

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

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