I was wondering if it was possible to get an SQLITE manager database onto a server? What i mean by this is so that when i complete my program in a java project and make an installer for that project. Anyone who downloads it from any computer running on any operating system who has administration rights can access the database without having connection issues. In addition anyone who logs in to the program can do so with full database connection.
Is there a way to do this? I also don't want the user who is going to install the program to install any additional programs for the database. In addition i would like this program to work on any computer who might not have the SQLITEManager plugin on there firefox web browser or even have firefox installed on there computer.
I would also like the admin to be able to edit anything on the online server the database should be on.
If this is not possible on SQLITE Manager could you recommend a database which can do this but also use and work on the code already made for the sqlite programs?
SQLite databases are just flat-files. What this means in layman's terms:
I download your database as a file.
I can modify it as I please.
I'm not forced to synchronize to the newer version of the flat-file.
You have a choice: You either write your code to force periodic synchronization of the SQLite flat-file to your clients, or you use a dedicated DBMS on your server, such as MySQL, and force your clients to connect to that.
Related
I have a MySQL database installed in my Amazon AWS instance (not RDS). The same database is installed in a personal computer, offline.
You have to connect to the amazon database via SSH, it is in a Ubuntu instance.
The online database contains information of 1000 users. The offline versions contain information only for that particular user.
Users use a Java desktop application to feed data into the local database. When they click on the Sync button, the 2 databases should be synced. Remember here that the desktop offline database should "upload" the newly inserted things to the online database while it should "download" new data (if any) related only to the particular user .
The system cannot be a manual way where someone manually turn on a 3rd party application, use putty or connect SSH, configure the databases etc and sync. The system should be embedded to the desktop java application.
I looked into things like SymmetricDS and it is too much complicated, not sure about the SSH access too.
Any idea about how to do this in an easy way? I am also creating a REST API thinking I can handle this manually, but if there is already built system/API I am onto it.
This is very simple and doable. Just use MySQL replication.
MySQL replication
Let me know if you want any further details. I can give you working model of my.cnf as well if required.
Br//
I have recently put all my java EE projects into my google drive so i can access them on my laptop and desktop computer. Some of my projects have a database component which I have the database stored in a MySQL server. Is there a way that I can export this database and just access it from like a database file which I can store in my project file so I can use it on both my laptop and desktop computer?
This is really what I would like:
-Be able to work on my java EE projects that have a database on both my computers
-Store my MySQL Server databases in a file which can go in my project folder then use java to access that database instead of going through the server
Any alternate ways of doing this would help me out this is just one way I can think of doing.
Note: I am using my laptop on the go so my desktop computer wont always be accessible from my laptop neither will I have an active internet connection always.
Thanks
Install MySQL on your laptop, then transfer database using backup/restore, e.g. using mysqldump. See https://dev.mysql.com/doc/refman/5.0/en/backup-and-recovery.html
This post is the continue of my previous question in here. So I had a look into how mySQL works with Java, but I noticed that the computer must have a database server to connect to the application. So what will happen when my software is ready and users want to run in a different computers? Can't I save the database file in the directory of the software, so any copy of the program will be connected to its independent database to save and parse data from it?
Just to make it clear, in a part of my software, I needs to keep record of previous interactions. Like a history table.
Would using JSON a better option in this case?
In a real world generally database servers are installed on a machine and softwares are installed on different machine.
We let software know the database configuration like database URL /database Name /username/Passwords etc (through property file or through JNDI configurationS).Then java program can connect to database with the help of JDBC driver.
Note:- one Database Server can Host many databases.
If you want to distribute your software without having dependency on client database. Then I would recommend you to use some inmemory DB.This DB you can embed with your software.(alternatively you can write logic that if client database can't be found then use inMemory DB..something like this).
H2 db is my favorite one and it also supports persistent mode and it support s many DB dialects including MYSQL .
Im working with a SQLite database right now, and I've made a javaFX application (I will call it the client) that allows me to work with it, but I need to work with it remotely as well. From what I've read SQLite does not support remote acces, so I have 2 choices:
Creating another application in the server that receives input from the client through a socket, and it modifies the SQLite database. (The problem with this, is that the server is a webserver and I dont have SSH access, so I can upload the server side application on the server, but I cant start it...)
(I dont know if this works) Create a java application that runs on the server, and you load it through a browser such as chrome or firefox. From what I've seen java webstart allows you that, but I don't if the app runs on the server or on your computer (meaning that you won't have acces to the SQLite database as well).
If someone here has some knowledge on this pls share, I need to know if I can make this work, and if not, what other options I have.
I don't think SQLite is designed for that. If you use SQLite because it's small and easy, why don't you try JavaDB (derby), it is included in your JDK distribution and you can use it embedded in your app or as a database server (not both of course).
I have to create a java application that can run entirely from a DVD. The application must connect with a database that will be also on the DVD. I was thinking to use an embedded database but i dont know much about them. Do i have to start the database server from my java application and if i do, how should i do it?
Thanks in advance.
Nick Tsilivis
You can use SQLite which is a very light weighted version of SQL. It stores its data in a single file. You even don't have to log in with an username and password. Just add this jar sqlite-jdbc to your projects build path. You cann access it by following:
Class.forName("org.sqlite.JDBC");
Connection connection = DriverManager.getConnection("jdbc:sqlite:your_database.db"); //"your_database.db" is the SQLite database file on your DVD.
/*manipulate your db by using PreparedStatement, ResultSet, ...
You must have installed SQLite on your system SQLite Download
That sounds like a job for SQLite. It runs completely in your own process, so there is no need to start an external database server.