Thread: Getting connected - Java application to PostgreSQL
I have a simple Java Application running on Windows 2000 I am working on at home. Initially it accessed data in an Access database via Jdbc:Odbc, but I detest Microsoft and their database is a limited, non SQL standard, particularly ugly and unreliable beast.
Now that I have installed PostgreSQL and installed some data, I want to point my application to it. Once I have a simple connection, I can make some progress on development of both client and server ends.
There are several bits to put in place. Has someone assembled a simple document to help people make this transition? If so please let me know.
I see the Postmaster needs to be running. Does that happen when you start the pgAdmin application from the Start menu?
Yours sincerely
Peter Cook
On Tue, 2005-09-13 at 12:11 +1000, Peter Cook wrote: ... > I see the Postmaster needs to be running. Does that happen when you > start the pgAdmin application from the Start menu? pgadmin is a client application like any other and need not be running on the same machine as the postmaster. The postmaster is started, usually at boot time, on the server. It must already be running when you try to connect to it with pgadmin. -- Oliver Elphick olly@lfix.co.uk Isle of Wight http://www.lfix.co.uk/oliver GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E 1EC0 5664 7A2F A543 10EA ======================================== Do you want to know God? http://www.lfix.co.uk/knowing_god.html
On Thu, 2005-09-15 at 11:37 +1000, Peter Cook wrote: > Oliver, > > Thanks fro your reply, but I still feel none the wiser. > > How is the Postmaster started? In Unix, by an init script at boot time. In Windows, it is normally a service - I don't know any more about Windows since I don't use it. > I have done nothing to start it, or put it in the boot sequence. This may > have happen as part of installation; I have no idea. If you are using a package such as for Debian or Red Hat, it is part of the installation of the server package. If you build PostgreSQL yourself, it is up to you to install an appropriate init script. I suppose the Windows package has something to start the service. If you need advice about Windows, ask the list. > Are you saying that the Postmaster must be running in order for me to log in > to pgAdmin? That would imply that the Postmaster is started as PgAdmin is > fired up. No. The postmaster is running all the time, from boot. It waits all the time for clients to connect to it. pgadmin is a client and can be running without connecting to any server (after all, you can't tell it where to connect to until it is running.) It can be on a completely different machine. If you tell it to connect to somewhere that has no postmaster running, the connection will fail. > What are the other bits I need to have in place? > What changes do I need to make to the Java application to change from using > an Access database to using a postgreSQL database. You need to tell it to connect to a different host and/or port. Again, I have never used Java or JDBC, so you need to ask the list for any more details if that doesn't help you. > A driver needs to be loaded, and a connection has to be made using a URL. > > Your sincerely > > Peter Cook > > > >From: Oliver Elphick <olly@lfix.co.uk> > >Reply-To: olly@lfix.co.uk > >To: Peter Cook <petercook69@bigpond.com> > >CC: pgsql-novice@postgresql.org, ttpcook@hotmail.com > >Subject: Re: [NOVICE] Getting connected - Java application to PostgreSQL > >Date: Tue, 13 Sep 2005 09:08:01 +0100 > > > >On Tue, 2005-09-13 at 12:11 +1000, Peter Cook wrote: > >... > > > I see the Postmaster needs to be running. Does that happen when you > > > start the pgAdmin application from the Start menu? > > > >pgadmin is a client application like any other and need not be running > >on the same machine as the postmaster. > > > >The postmaster is started, usually at boot time, on the server. It must > >already be running when you try to connect to it with pgadmin. > > > >-- > >Oliver Elphick olly@lfix.co.uk > >Isle of Wight http://www.lfix.co.uk/oliver > >GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E 1EC0 5664 7A2F A543 10EA > > ======================================== > > Do you want to know God? http://www.lfix.co.uk/knowing_god.html > > > > _________________________________________________________________ > SEEK: Over 80,000 jobs across all industries at Australia's #1 job site. > http://ninemsn.seek.com.au?hotmail > -- Oliver Elphick olly@lfix.co.uk Isle of Wight http://www.lfix.co.uk/oliver GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E 1EC0 5664 7A2F A543 10EA ======================================== Do you want to know God? http://www.lfix.co.uk/knowing_god.html