network server mode vs embedded mode in JavaDB - java

I am trying to develop a desktop application to be run on local network. It has two UI. One for users to log in complaints and another one to process the complaints. Both of them are connected to a single database. Now i want to know weather i should use the JavaDB in embedded mode or network server mode to implement this and what is the difference between the two approaches.

In embedded mode the database code runs in the same process as the embedding application. The database files are locked, no other process can access the database files. This is the right choice if you have only one application with one user per database. The advantage over network mode is that there is no network traffic to access the database.
In network mode the database code runs in its own process (the database server). Client applications can access the database over the network. Several client applications can access the database at the same time. So this should be the right choice for you, because you have two different client applications accessing the database at the same time.

Related

Local Database for Java application

I have a client server based application.
The server is PHP with MySQL, no big functionality, just for keeping my data and providing and administration interface.
The client is a Java (FX) application.
Unfortunately the connection between the client and server is not permanent, so I have to have a local copy of the database for the case the server if not accessible.
Most of the times the client only reads data from the database but there are a few cases when it needs to update it.
My question is: what is the better solution to keep up a local copy of a MySQL database and track changes (to be updated in MySQL next time it is available).
It is a complicator factor that I do not need the full database locally, it would be too large, I need only the user specific information (user is authenticated by local machine username)
Do you have any idea? :)
Thanks:
Levente

Saving data from android app to remote server

I am just a beginner in android app development and that's why I have many doubts. I am building one application where the user enters some data in editText. Now I want to save that data in my database. My database is running on my laptop. How would my app connect to the database? Do I need a web server in between? If yes then which web server is used for Android apps? Basically, i want to know the flow of data from app to the database.
Study more from Udacity.com, its free.
You may use a jdbc Connector to connect to database.
Connect your jdbc connector over local network ip\servername and database connection string
You can use REST Service when it comes to web Service on Android like this. You can either pass the values as parameters or an Object depending on your requirement. All the best
Wamp server is best option to play with server related utilities.You can use it even if you are offline. and it provides various option for data storage. It Mainly uses MySql and PHP scripts for fast performance.
For More details Click Here

Create multi user JAVA program, with Derby, assigning Server dynamically

I´d like to create a Java application to distribute to users in a LAN, where the first who runs the app becomes the server, all the others must access to Derby DB such that they are clients. In my scenario I couldn't leave Derby running as a service, but must be started at first run of the app. Some hints?

Desktop app connecting to a remote Amazon RDS mysql instance

I have a java swing desktop app that needs to connect to a remote mysql instance over jdbc. I was thinking of using Amazon RDS for this and creating a security group with an IP of 0.0.0.0 - effectively allowing all IPs to connect to the mysql instance.
I understand that there are security implications with this approach and we should ideal front a remote database with a web application. The desktop app should access the web application via rest/soap and then get access to the db behind it via services exposed by the web app.
Now that's a lot of work. Since I already have the desktop app connecting to a local DB. I just want to move the DB over onto the cloud so that a user can access the same DB from any other system where the same java swing app is installed.
Could someone help me by listing out the security implications on exposing an Amazon RDS DB out on the internet like this?
Also, more importantly, are there any ways of eliminating these risks? Such as SSH Tunneling for example?
The best method is the SSH Tunneling using the KEY that generates by Amazon.
You can also open an ip with the mask IP of 23.43.65.0/24 and also create a VPN with your desktop and Amazon.
I know that when I leave a DB open to the world, which I don't normally do, 24 hours a day, 7 days a week automated process keep trying to login in about 10-15 times per second, all day, every day guessing user names and passwords.
If you go this route, which I don't recommend, better make sure your passwords are very, very hard to guess and if you can rename the built-in accounts to something other than 'admin' or 'administrator' all the better.

1&1 Mysql connections with JAVA problems

I made a java program in which users would be automatically inserted/selected lines into/from one mysql database, but could not modify any existing lines, tables, db, or privilages. I got myself a website and hosted it in 1and1.com, but sadly I found out that its a pain(impossible) to have multiple users for one database and to remotly connect to a database.
I was wondering what are my options here?
I suppose the first one would be to get another host that allows me to do this.
The only other option I can think of is that somehow I manage to send from java the information to my website, and then the website to connect to the database. (not an expert in php, html, or what ever i ahve to do (be by embbedding a browser on my GUI or by doing it under the hood).
This is my first attempt to create a program that connects to an online database, so please be nice.
Note: program worked in localhost.
1&1 support useless.
Almost all (web)applications that use a database, connect to the database with one database user for the whole application. Having a different database user for each user of the application is an uncommon design.
So, you should configure one database user, which the application uses to read from or write to the database; this database user is independent of the users of your application and is shared by all users of your application. There should not be a one-to-one mapping from application users to database users.
There are different reasons for this. One of them is scalability. Most databases cannot handle thousands of connections at the same time. If you have a web app that allows thousands of concurrent users, you don't want to have a database connection with a unique username for each of those users. Instead you want to use a connection pool with a limited number of database connections; the connections in the pool are reused whenever one of the web app users needs to perform an action that accesses the database.

Categories