I developed a java swing application by using hibernate connection and MS SQL server for database. Application is working fine. And I know the way to create and EXE and the installer for application.My question is, how I install this application to another computer with database. Should I install the SQL server on that computer or is there any way to use the db without installing the whole SQL server in that computer.
As far as i know there is no way of using database without installing the SQL Server, unless you configure in a way that the application will communicate with the db on your pc, but that's complicated
A different approach to this would be for you to make a view in the database and extract the data you need to a csv file, include that file in the resources folder of the application and then use Lucene to query over it
Take a look at how to get started: here
When you need to update the data in the file you can release updates for the application that would include these changes in the csv file/s
Related
Should I do the "Embedded Database" if I want the program I created with the database to be able to access another computer?
I finally export my Java application as an executable file/application file, but my only problem is that its database needs to be always connected to the database I created. So, when I run it, It runs perfectly but I cannot access my database unless the NetBeans is running in the background. But I want it to be able to run independently without NetBeans and needing to connect to the database every time so that I can run it to my other computer. I read that I should create an embedded database so that when I try to open the file to another computer, the database is included.
Is my understanding right? I created a database using JDBC.
if you want to connect to your database in other computer,you'd better create your database on Server which connected to the Internet.
It depends on the type of application which you are going to develop.
If your application is a single-user standalone system then it's perfectly fine to use an embedded database. Example: Single-player game.(In here application's database is hosted within the user's machine so other users can't access those data)
But if you are developing an application which is having more than one user and those users need to share their data with others then you should go for a database like Amazon RDS which is hosted on the cloud, because then you can share those data among all the users.
(Ex: Microsoft Teams Application)
Finally, I should say yes you don't need to have NetBeans working if you select either one of those options.
I'm working on a plugin for an emulator that is going to allow people to host a control panel through a website to view statistics, etc; Currently I have XAMPP installed which is running my SQL Server, and the HTTP Server is being handled through the Netty networking library in Java.
I'm curious as to if there is a way to host the SQL Server from within Java, similar to the HTTP Server. It'd also greatly simplify the process of installation for the plugin.
The other option was to use ObjectDB, but after looking into it, it seems like it requires Quercus and I don't want to go through that.
The term you're looking for is "embedded database".
There are a number of databases that you can use as an embedded database, and you can choose to use them as an in-memory database (which means the data is gone when your application stops) or make them save data to a file on disk, so that the data is still there when you stop and re-start the application.
Examples of databases that can be used in this way: H2 Database, HSQLDB, Apache Derby.
I would like to ask a question about jar and database connection. I performed an application and converted to jar file. Jar file works if I open NetBeans's Service which is server(I have created my tables on jdbc:derby://localhost:1527/sample). But I want to open jar file without opening NetBeans and its service server. The application should work on other PCs if the jar file clicks.
I have searched a lot about this but I do not know how I can do. For example, if I use file database (MSAccess) with ucanaccess driver, will this support JPA(Entity Beans) and JDBC ? Because I have used JPA and JDBC together in my application. I have also searched embedded database but when I create the embedded database and table, I can not access table. It gives me an error which is "Table/View does not exist".
Please help me.
What should I do if I use JDBC and JPA together in my application ?
And If I want to open the jar file other PCs and they can reach database information, what should I do ?
Best regards.
I am new to derby+Netbeans, but from your explanation and this link -
https://netbeans.org/kb/docs/ide/java-db.html#configuring
It seems you are using internal Java DB which comes with Netbeans Glassfish server.
Therefore when you start the server from netbeans it works.
Try external installation of database as shown in the above given link. It should work outside Netbeans.
I want to ask best server for a simple desktop java application.
Please suggest me a server using which i can port my database files on another computer.
can i have an option of MYSQL server 5.1.
in which i develop my application and then i can easily port it to another computer as it is with database.
Not really sure about your application requirements, but for simple application look at embedded databases like Apache Derby.
MySQL and really any other database are also quite straightforward to transfer via data dump/load. In case of MySQL even the data files copy will work.
I make a java application using netbeans that connect to database , but i have a problem , i want to embed mysql database with the executable jar file , so when i take this jar file and run it on any pc that doesn't have mysql server it will run with database , i thought about include the mysql-installer.exe and make a script to install the mysql server , but i can't find how to do that ,also i read about Connector/MXJ does it work if the user run the application and he does not have mysql server , any suggestion or article about this.
Derby is a pure-java DBMS. You bundle the derby jar with your program, just as you would any other library. This is a much cleaner way of ensuring your user has a db for your program, as you're not adding any dependencies.
Usually distributors don't include standalone databases, such as MySQL or Oracle, with their
application. If needed, they provide SQL script to build the database and make the user type in the database host, username and password and make a script to build the database. If you want to "ship" the database with your application then I would consider more lightweight databases such SQLite (singe file database).