Re: Java client on local machine update database on server

Поиск
Список
Период
Сортировка
От Noel
Тема Re: Java client on local machine update database on server
Дата
Msg-id 3FB2DA2A.6050104@med.monash.edu.au
обсуждение исходный текст
Ответ на Java client on local machine update database on server  ("Kieran Clinton Tarestad" <k.tarestad@uea.ac.uk>)
Список pgsql-novice
Hi,

Kieran Clinton Tarestad wrote:

Hi,

I’m doing a project where I will have a java GUI on a clients machine and I want it to have the ability to receive input from a user and then update a postgresql database (but wouldn’t have to be straight away). I can currently think of two ways of doing this:

Firstly turn the user input to a set of SQL statements and save into a text file and then create a transaction that will connect to the database on the server and execute them all.

It would be best to do it stright away, which allows the database to always reflect it's current state, using java rmi is a stright forward way of doing it. http://www.java.sun.com/products/jdk/rmi/
Another option is to use a web interface and use PHP or perl to interact with the database.

Probably an easier way would be to have a copy of the database on the clients machine and copy the database to the server every night or so.

Would either of these ideas work? Which seems less crazy? Is there an easier way?

You would need to run a replication tool to do that, such as postgres-r. Which ensures that all client database are the same, ie syncronised.
Having the database replicated on client machines means that you will have to set them up indervidually and if each client's OS is different, which may be a pain. Simplest solution would be having the clients connect directly to the database on the server.

Good luck

Noel

В списке pgsql-novice по дате отправления:

Предыдущее
От: "Kieran Clinton Tarestad"
Дата:
Сообщение: Java client on local machine update database on server
Следующее
От: Godshall Michael
Дата:
Сообщение: Re: [ADMIN] SQL-Statement