Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

driver error

Status
Not open for further replies.

djam

Technical User
Nov 15, 2002
223
CA
I have a postgres database on a different server (Unix). I'm usind jdbc to connect to the database. I would like to connect to it from home on a Windows 200 machine. I installed the latest drivers entered the correct information into the 'database','server','user name','port','password'

Should I have a pg_hba.conf file? I didn't download Postgres, I only have the driver...
when I run the java program, I get this error message:


System Exception in connect
Something unusual has occured to cause the driver to fail.

Please report this exception: Exception: java.sql.SQLException: No pg_hba.conf entry for host 200.6.1
73.208, user djam, database djam
Stack Trace:

java.sql.SQLException: No pg_hba.conf entry for host 200.6.173.208, user djam, database djam
at org.postgresql.Connection.openConnection(Unknown Source)
.........
.........
.........


thanks " ahhh computers, how they made our lives much simpler ;) "
 
Hi djam,

You don't need a pg_hba.conf on your home computer. Each postgres server has its own pg_hba.conf file. It sound like you need to add/modify a host line on the unix's pg_hba.conf file to allow you to access it from your home computer.

LelandJ





LIMIT Clause

LIMIT { count | ALL }
OFFSET start

where count specifies the maximum number of rows to return, and start specifies the number of rows to skip before starting to return rows.

LIMIT allows you to retrieve just a portion of the rows that are generated by the rest of the query. If a limit count is given, no more than that many rows will be returned. If an offset is given, that many rows will be skipped before starting to return rows.

When using LIMIT, it is a good idea to use an ORDER BY clause that constrains the result rows into a unique order. Otherwise you will get an unpredictable subset of the query's rows---you may be asking for the tenth through twentieth rows, but tenth through twentieth in what ordering? You don't know what ordering unless you specify ORDER BY.

As of PostgreSQL 7.0, the query optimizer takes LIMIT into account when generating a query plan, so you are very likely to get different plans (yielding different row orders) depending on what you use for LIMIT and OFFSET. Thus, using different LIMIT/OFFSET values to select different subsets of a query result will give inconsistent results unless you enforce a predictable result ordering with ORDER BY. This is not a bug; it is an inherent consequence of the fact that SQL does not promise to deliver the results of a query in any particular order unless ORDER BY is used to constrain the order.

Leland F. Jackson, CPA
Software - Master (TM)
Nothing Runs Like the Fox
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top