database.sarang.net
UserID
Passwd
Database
DBMS
MySQL
ㆍPostgreSQL
Firebird
Oracle
Informix
Sybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
PostgreSQL Q&A 4289 게시물 읽기
No. 4289
커넥션에러가... ㅠ.ㅜ
작성자
tester(tester)
작성일
2002-08-07 16:00
조회수
1,076

로컬(솔라리스)에서 커멘드상에서는 접속이 잘 돼구여... >>psql anypass

 

리모트상에서 jdbc로 접속하려 하는데 에러가 발생하네여... ㅠ.ㅜ

 

소스 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

import java.sql.*;

public class psql {
  	public static void main(String args[]) {
  		Connection con = null;
  		Statement stmt = null;
    		System.out.println("*************************** debug ***************************");
    	try {
    		Class.forName("org.postgresql.Driver");
    		System.out.println("driver load OK~!");
        } catch(Exception ex) {
        	System.out.println("driver load Exception");
			System.out.println(ex.getMessage());
		}
    		System.out.println("*************************** debug ***************************");
    	try {
    		con = DriverManager.getConnection("jdbc:postgresql://***.***.***.***:5432/anypass", "id", "passwd");
    		System.out.println("connection OK~!");
    	} catch(SQLException ex) {
    		System.out.println("SQL Exception");
    		System.out.println(ex.getMessage());
    	} catch(Exception ex) {
    		System.out.println("connection Exception");
    		System.out.println(ex.getMessage());
		}
    		System.out.println("*************************** debug ***************************");
  	}
}

에러:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

*************************** debug ***************************
driver load OK~!
*************************** debug ***************************
SQL Exception
Something unusual has occured to cause the driver to fail. Please report this exception: Exception:
java.sql.SQLException: FATAL 1:  No pg_hba.conf entry for host 172.21.106.30, user postgres, databas
e anypass

Stack Trace:

java.sql.SQLException: FATAL 1:  No pg_hba.conf entry for host 172.21.106.30, user postgres, databas
e anypass

        at org.postgresql.Connection.openConnection(Connection.java:178)
        at org.postgresql.Driver.connect(Driver.java:149)
        at java.sql.DriverManager.getConnection(DriverManager.java:512)
        at java.sql.DriverManager.getConnection(DriverManager.java:171)
        at psql.main(psql.java:17)
End of Stack Trace

*************************** debug ***************************

pg_hba.conf :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

local      all                                          trust
host       all         127.0.0.1     255.255.255.255    trust

이상입니다...

 

머가 잘못된건지 통 모르겠네여.. ㅠ.ㅜ 부탁드려여...

이 글에 대한 댓글이 총 2건 있습니다.

############### 어느정도 알아낸 바루는여... ############

 

리모트가 아닌 로컬루 접속해서...

 

con = DriverManager.getConnection("jdbc:postgresql://***.***.***.***:5432/anypass", "id", "passwd");

 

이부분에서 아이피를 localhost로 바꿔주면 돼는군여...

로컬에서도 아이피로는 접근이 안돼구여...

 

pg_hba.conf 이 파일에서 설정해줘야 할거 같은데... 어케 해줘야 하는거져...?

 

부탁드려여.. (--)(__)(^^)

 

##############################################

tester(tester)님이 2002-08-07 16:56에 작성한 댓글입니다.

postmaster -i

흘흘`님이 2002-08-31 10:18에 작성한 댓글입니다.
[Top]
No.
제목
작성자
작성일
조회
4298대용량 디비 [1]
조연
2002-08-14
977
4296펑션에서 쿼리문의 상태를 알아내고 싶은데요
눈love
2002-08-13
829
4294postgresql에서 포린키에 대해서 [1]
2002-08-12
996
4295┕>Re: Foreign key 지원됩니다.
정재익
2002-08-12 22:09:54
1059
4289커넥션에러가... ㅠ.ㅜ [2]
tester
2002-08-07
1076
4290┕>Re: 커넥션에러가... ㅠ.ㅜ
정재익
2002-08-08 09:12:58
918
4288data를 복구하려면 어케해야하지요? [1]
초보
2002-08-06
1005
4287한글 검색이 이상해여 도와주세요
장승현
2002-08-06
911
4286postgresql-7.1.3-win32 에서는 디비생성을 할 수 없나요?
루나
2002-08-06
915
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.017초, 이곳 서비스는
	PostgreSQL v16.2로 자료를 관리합니다