Re: Java client on local machine update database on server

From: Noel <noel(dot)faux(at)med(dot)monash(dot)edu(dot)au>
To: Kieran Clinton Tarestad <k(dot)tarestad(at)uea(dot)ac(dot)uk>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Java client on local machine update database on server
Date: 2003-11-13 01:11:06
Message-ID: 3FB2DA2A.6050104@med.monash.edu.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Godshall Michael 2003-11-13 18:06:43 Re: [ADMIN] SQL-Statement
Previous Message Anis W. Nugroho 2003-11-12 15:41:48 Re: pg_dump: Exporting SQL and data for a schema ONLY??