i have Java-Application that growth a lot over the past month.
All configurations from the programm and all the logs are stored in .txt or .log files.
The programm should change now. The user could install the programm on his own pc but the programm itself should get all the configurations from a central server also write the logs into a central place.
the problem is that we can't install a software on the server, we just have file read/write access to some shares.
so i'm looking for a database that stores the database file on a server without a server installation.
this is new for me so i have some problems with the technics. i checked H2, but i just see a server mode and a embedded mode. i need something like a embedded mode with "external" filebase.
any suggestions for me ?
HSQLDB can be embedded into a any program.
Like Jayan told me in a comment to my question
embedded mode does accept a location to save the data.
Related
Hello and good morning!
I have created a folder named db and imported a database file into that folder in my project in eclipse. When I try to stablish the connection I get an error saying unknown database “users” I understand the URL is set to localhost so the driver doesn’t see the database. Fix I’m looking for is
1. Where in the computer is localhost located so I can put my database file there?
2. How can I read and write to the database located at my project location or any other location than localhost?
I’m using JDBC and the MySQL server is running.
Thanks in advance
A MySQL database runs as a process somewhere (the local computer or remote server). The file or folder you have may be the data itself, but it's just sitting there, doing nothing. You'll need to load it in MySQL to use it, a process known as "import".
If you happen to have a file with "data", you need to somehow IMPORT it into the database server. If you are using MySQL server, then:
Is it installed in your local computer?
Is it running?
Do you have a username/password to connect to it?
Did you create a new schema/database to store your data?
If you are good with the above, then you can start importing the data into your database, tables, indexes, etc.
Once the import is finished then you can start querying the data as you wish, by connecting to the MySQL server using JDBC or any other technology you want.
Hi I have been doing some manual tasks which consume some of my time and I want to automate it the tasks are:
Connecting to remote windows server using mstsc command and restarting some services.
Connecting to remote windows server and modifying the files, checking the modifications and then again reverting the changes when the changes are tested.
I want to know whether I can achieve a one click solution for this scenario by writing some code in java and reducing the manual time.
Or is there any other solution for the same which can be generic and could be implemented on other servers too.
The steps for the solution to cover would be:
Connect to remote machine using username and password.
Restarting the services from the code or just executing a batch file for the same which could be lying in some folder on the same machine.
Modifying some files on the remote machine.
I do not want to install a database server on target machine. It is possible that we can simply ship a jar file with the database embedded in it, and not worry about installing a database server separately?
I created one application in netbeans using derby and it is working fine in my pc but when i am running on other machine it is giving me Error connecting to server localhost on port 1527 --> this error says that there is no Database running on port 1527. but i dont want that the client should take more efforts to start DB server and all technical process. It should be simply runnable when i start application Derby DB should start and when i close DB should close.
So what will be the solution for my problem?
And one more Question is Can i use derby database for large scale projects?
No, you don't have to install a database server on the target machine; Derby works just fine in embedded mode without a separate server.
However, if you want multiple client applications to be actively sharing the same data in the same database, you'll want to use the client-server mode, not the embedded mode.
And yes you can embed a jar with the database into your program. If you want to know how, read this documentation: http://db.apache.org/derby/docs/10.11/devguide/cdevdvlp24155.html
And yes you can use Derby for large scale projects. But it doesn't come with all the enterprise features (online backup, etc.) that a true enterprise scale commercial DBMS comes with.
But, since it sounds like you are just getting started with Derby, can I suggest that you please start with the Derby tutorials before you try these advanced configurations? Here is the link to the Derby tutorials: http://db.apache.org/derby/docs/10.11/getstart/
It may not be possible to give you very good advice without knowing a lot more about the application you're trying to build and the overall architecture you're trying to use.
I have derby DB working fine in embedded mode through my netbeans IDE as am
developing accounting multi-user systems ,it's my first time with Derby and understood later embedded
mode not allowing multi users/pcs, only single user, so i decided to move my Derby
into server mode and am trying for days changing environment variable to convert to server mode ,and change my embeded one into server one is possible or i have to drop the derby and install server mode ,now am attempting to run derbyrun.jar from my Linux terminal but i have got below error message .
wso here i can put the jar file to avoid seen below error :
java -jar derbyrun.jar server start
Error: Unable to access jarfile derbyrun.jar
any help will be great
It sounds like derbyrun.jar is not in your classpath.
I suggest you take a couple hours and work through the Derby Getting Started guide here: http://db.apache.org/derby/docs/10.11/getstart/
In particular, there is an example in that manual of taking a Derby application which runs with the embedded driver, and converting that application to use the client driver: http://db.apache.org/derby/docs/10.11/getstart/twwdactivity4.html
In general, all you have to do is to change your connection URL, include derbyclient.jar in your classpath, and have a running Derby Network Server that is providing access to your database.
To run the Derby Network Server, you should start with the startup scripts that are provided in the Derby distribution; this, too, is covered in the Getting Started guide.
I just want to know how I can start derby in network server mode and still be able to get an embedded connection?
Thank you.
You need to launch Derby in "embedded server mode". If you are already using Derby in embedded mode, this can be enabled by providing the necessary files in your classpath, then specifying a handful of command line arguments when launching the application.
First make sure the following jars are in your application's runtime classpath.
derby.jar derbynet.jar
Then add the following command line options to the Java command used to launch your application. If the class files are missing, these options will have no effect.
-Dderby.drda.startNetworkServer=true
-Dderby.drda.portNumber=8011
I'm running Derby from within a servlet hosted by Tomcat, so I added these options to the catalina.bat file.
Start up your application and check the list of open network sockets.
netstat -an | find "8011"
You should now see Derby listening for connections on 8011. Its now possible to connect to the database using Derby's client driver (derbyclient.jar). The instructions at http://docs.oracle.com/javadb/10.3.3.0/adminguide/radminembeddedserverex.html cover this part pretty well.
It was hinted that running Derby in this mode may be discouraged. I don't believe that to be the case. Your application will continue to access the database using the embedded driver, while other software is now permitted access using the client driver.
The Embedded Server mode sounds like what you are asking for. It allows you to start a network server when you start the embedded database.
It sounds contradictory that you want to start derby in network server mode and get the embedded driver. Even if this might be possible, it is definitely discouraged. You should decide on whether you want to use Apache Derby in the network mode using the DRDA or as an embedded driver and stick to that decision.
Here you'll find a tutorial on how to use the network driver:
http://db.apache.org/derby/papers/DerbyTut/ns_intro.html
Some one correct me if i am wrong, Both will run on separte ports. So you can connect to the required one using the proper connectionName, right?
#pawelocue: Sorry, but this is wrong. Using the embedded server mode is perfectly alright and sometimes very useful. It is definitely not discouraged.