This question already has an answer here:
Starting Derby Programmatically
(1 answer)
Closed 5 years ago.
I am using JDK 8, in windows 10. I am developing a desktop based standalone JavaFX GUI application by using JavaDB and Hibernate. I can start the database from Net-beans and it is working fine. But to use the database either i need Net-beans or command line. But when it will be in production then what will happen?
So, i want to know is there any way to start the database from java source code?
I think it is possible because if Net-beans can do it why we will not.
Typically in production DB servers are kept always in running mode.
From the application you just need to connect/disconnect with the db server.
So, I think you must not code to start/stop the db server in production. If you do this it will be a bad design.
Related
This question already has answers here:
Run a command in a shell and keep running the command when you close the session
(9 answers)
Closed 7 years ago.
I have my spring boot application, I normally work with wars that I deploy on tomcat, but I want to try this way a little bit more.
My problem is that when I deploy it in a server, and I do
java -jar target/myproject.jar
Works pretty fine, but after a time without use, the shell gets disconnected and soon after it (I believe because the shell) the process stops.
Any idea how to deal with this?
I am using Debian.
Thanks.
Basically, create a .sh file and set it on /etc/init.d/YOURFILE.sh with the info of this post
Run a Java Application as a Service on Linux
Later just make a /etc/init.d/YOURFILE.sh start and thats it..
I have built a GUI application in Java using Netbeans 8.0 and have linked it to a MySQL database on my system using JDBC.
This application provides login functionality to its users and lets them take a survey.
My problem is to host this application on the internet and collect the data filled by users in MySQL database.
Can someone please suggest how to go about this??
I am a newbie and have tried using java web start to make this work.But no success yet.Please suggest how should I go about this.I'm saturated with all the googling.
I don't get what your problem is. Normally a GUI application is a program which can run on a desktop machine. If I understood well, you want to create something which connects to a remote database. You can do this with your application but you need to distribuite it along the users. If you want to run a java code on host so that people can use it in internet like a webpage you need one of these:
applets
a webserver capable which can run java and jsp/jsf or whatever
If you can be more specific I can help you in a better way.
Cheers
This question already has answers here:
Run Java class file from PHP script on a website
(5 answers)
Closed 8 years ago.
i have a PHP script which is provide to my one of the friend he is java developer.
that script is on class which is in java language.
i need to run that java program to complete my task. i need to run sum action once in day, and perform sum logical action and updated my data in database everyday.
Please let me know i to do it in php.
here is my java program code.
Run it the way you would run any command line program
var_dump(exec('java yourprogram'));
Perhaps in my opinion the best way would be as follows:
Run your java application on your server with another port (say port 1212)
If it is not needed outside your web server, better restrict the apache tomcat server not to expose port 1212 to anyone outside localhost (you can achieve it with iptables on linux)
Now from PHP, make CURL calls to your java application like http://localhost:1212/my_jar_code.jsp
Use it like web services, problem solved!
In this way your java code will be independent of your php code and you have complete compatibility and power on both java and php codes.
This question already has answers here:
How can I display a VNC Viewer in a Java rich client (LGPL, Apache, MIT license)?
(3 answers)
Closed 9 years ago.
I have two computer in different network.I want to control one system from another.Both system have windows 7 operating system.Do any one have any idea how to do it??
I don't want to use team viewer or any other application.
VNC has been the most popular choice when it comes to remote desktop/computing. Check out this open source implementation called TightVNC, it even has a viewer application implemented in Java:
http://www.tightvnc.com/release-jviewer2.php
You can install Teamviewer into both computer.
I don't think that have a relationship with java and swing.
I think that you should correct the tags.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Java Installer - help needed
Hi and thanks for taking the time to answer my question.
I intend to use Launch4J or SmoothJ as installers for my desktop app developed in Swing. However along with the app I need to install a DB locally at the client. My question would be, how to bundle the installation of the app along with the installation of DB at the client?
Thanks
With SQLite, there is no installation of the DB. The data is stored in a file, and your application makes calls to the SQLite API which access that file.
From http://www.sqlite.org/zeroconf.html:
SQLite does not need to be "installed" before it is used. There is no "setup" procedure. There is no server process that needs to be started, stopped, or configured. There is no need for an administrator to create a new database instance or assign access permissions to users. SQLite uses no configuration files. Nothing needs to be done to tell the system that SQLite is running. No actions are required to recover after a system crash or power failure. There is nothing to troubleshoot.
SQLite just works.