Re: Connecting to postgreSQL - Mailing list pgsql-jdbc

From Kevin Grittner
Subject Re: Connecting to postgreSQL
Date
Msg-id s3342363.056@gwmta.wicourts.gov
Whole thread Raw
In response to Connecting to postgreSQL  ("Peter Cook" <ttpcook@hotmail.com>)
List pgsql-jdbc
Greetings Peter,

Since I haven't noticed any responses here, I'll take a shot at it.

Start with this:

http://jdbc.postgresql.org/documentation/80/index.html

A lot of your questions should be answered in sections 1 through 3.

You do not need to unzip jar files to use the contents -- put the jar
file(s) on the classpath, rather than the directory in which they reside.

I'm not sure how you would use ODBC directly in a Java app, so
your question comes down to using the JDBC driver directly, or using
the JdbcOdbc bridge.  Your performance and reliability are almost
certainly going to be better with the JDBC driver.  It allows your Java
application to talk to the database directly through a TCP socket.

You will need to configure your postgres back end to allow TCP
connections from the appropriate IP addresses.  The default is really
tight security, which disallows everything.  You will need to speicify
what connections are allowed in the pg_hba.conf file in your data
directory (assuming a standard installation).  Also, in your
postgresql.conf file you will have to mofify the listen_addresses line.

See this for more info:

http://www.postgresql.org/docs/8.0/interactive/index.html

I hope this is helpful.

-Kevin


>>> "Peter Cook" <ttpcook@hotmail.com> 09/22/05 7:27 PM >>>
I have a Java Application runnibng on Windows 2000.

Initially it accessed an Access database, and now that I have installed
postgreSQL, I want to configure it to access postgreSQL.

(1) Is there a single document that can take me through the steps, or can
someone give me a simple checklist of what I need to do.
(2) I was using JdbcOdbc to use the Access database, is it possible to use
JdbcOdbc to
access postgreSQL
(3) what are the pros and cons of using JDBC, ODBC and JdbcOdbc

I have a data/jdbc directory with three jar files. I expect I need to unpack
one or all three.
I have included this directory in my CLASSPATH.

I Postmaster appears to be running after system startup because I don't need
to do anything
to fire up pgAdmin.
I read where the -i flag needs to be set for TCP/IP use. How is the
Postmaster started? There must be a
batch file that starts it. I will need to amend the parameters. Also, I see
in one document that
the -i flag is deprecated and the -h flag is prefered.

I hope you can clarify this jumble of discordant information.

I would appreciate your help.

Your sincerely

Peter Cook

_________________________________________________________________
SEEK: Over 80,000 jobs across all industries at Australia's #1 job site.
http://ninemsn.seek.com.au?hotmail


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org


pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: Connection to unix socket
Next
From: Jeffrey Tenny
Date:
Subject: Tracing commits on the server